added testcase
This commit is contained in:
parent
d29cac2130
commit
0901edf8eb
@ -53,6 +53,17 @@ def _server(request) -> Generator[str, None, None]:
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('_server', [({
|
||||||
|
'keys': ['one', 'two', 'three'],
|
||||||
|
'max-size': '100',
|
||||||
|
'max-data': 1234,
|
||||||
|
'buffer-size': '12MiB',
|
||||||
|
})], indirect=['_server'])
|
||||||
|
def test_invalid_api_key(_server):
|
||||||
|
response = requests.get(f'{PROTOCOL}://{HOST}:{PORT}/zeros?api_key=four&size=100', timeout=TIMEOUT)
|
||||||
|
assert response.status_code == 401
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('_server', [({
|
@pytest.mark.parametrize('_server', [({
|
||||||
'keys': ['one', 'two', 'three'],
|
'keys': ['one', 'two', 'three'],
|
||||||
'max-size': '100',
|
'max-size': '100',
|
||||||
@ -85,13 +96,16 @@ def test_request_size_upper_bound(_server):
|
|||||||
|
|
||||||
@pytest.mark.parametrize('_server', [({
|
@pytest.mark.parametrize('_server', [({
|
||||||
'keys': ['one', 'two', 'three'],
|
'keys': ['one', 'two', 'three'],
|
||||||
'max-size': '100',
|
'max-size': '100KB',
|
||||||
'max-data': 1234,
|
'max-data': '100KB',
|
||||||
'buffer-size': '12MiB',
|
'buffer-size': '12MiB',
|
||||||
})], indirect=['_server'])
|
})], indirect=['_server'])
|
||||||
def test_invalid_api_key(_server):
|
def test_request_max_data_used(_server):
|
||||||
response = requests.get(f'{PROTOCOL}://{HOST}:{PORT}/zeros?api_key=four&size=100', timeout=TIMEOUT)
|
response = requests.get(f'{PROTOCOL}://{HOST}:{PORT}/zeros?api_key=one&size=100KB', timeout=TIMEOUT)
|
||||||
assert response.status_code == 401
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
response = requests.get(f'{PROTOCOL}://{HOST}:{PORT}/zeros?api_key=one&size=1', timeout=TIMEOUT)
|
||||||
|
assert response.status_code == 500
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('_server', [({
|
@pytest.mark.parametrize('_server', [({
|
||||||
|
Loading…
Reference in New Issue
Block a user