Changeset View
Changeset View
Standalone View
Standalone View
swh/scanner/tests/test_scanner.py
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | def test_scanner_raise_apierror_input_size_limit( | ||||
request = ["swh:1:cnt:7c4c57ba9ff496ad179b8f65b1d286edbda34c9a" | request = ["swh:1:cnt:7c4c57ba9ff496ad179b8f65b1d286edbda34c9a" | ||||
for i in range(901)] # /known/ is limited at 900 | for i in range(901)] # /known/ is limited at 900 | ||||
with pytest.raises(APIError): | with pytest.raises(APIError): | ||||
event_loop.run_until_complete( | event_loop.run_until_complete( | ||||
pids_discovery(request, aiosession, api_url)) | pids_discovery(request, aiosession, api_url)) | ||||
def test_scanner_get_subpaths(tmp_path, temp_paths): | def test_scanner_get_subpaths(temp_folder, tmp_path): | ||||
paths = temp_folder['paths'].keys() | |||||
pids = temp_folder['paths'].values() | |||||
for subpath, pid in get_subpaths(tmp_path): | for subpath, pid in get_subpaths(tmp_path): | ||||
assert subpath in temp_paths['paths'] | assert subpath in paths | ||||
assert pid in temp_paths['pids'] | assert pid in pids | ||||
@pytest.mark.options(debug=False) | @pytest.mark.options(debug=False) | ||||
def test_app(app): | def test_app(app): | ||||
assert not app.debug | assert not app.debug | ||||
def test_scanner_result(live_server, event_loop, test_folder): | def test_scanner_result(live_server, event_loop, test_folder): | ||||
Show All 15 Lines |