diff options
Diffstat (limited to 'src/test/test_pydrilla.py')
-rw-r--r-- | src/test/test_pydrilla.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test/test_pydrilla.py b/src/test/test_pydrilla.py index 9e87704..89b499f 100644 --- a/src/test/test_pydrilla.py +++ b/src/test/test_pydrilla.py @@ -61,15 +61,26 @@ def test_api_basic(client): response = client.get(f'/{item_type}s/helloapple?ver=2021.11.10.999') assert response.status_code == 404 - response = client.get(f'/{item_type}s/helloapple?ver=random_input') + response = client.get(f'/{item_type}s/helloapple?ver=random_bad_input') assert response.status_code == 400 + response = client.get(f'/{item_type}s/random-bad-identifier') + assert response.status_code == 404 + response = client.get(f'/{item_type}s/helloapple?ver=all') definitions = json.loads(response.data.decode()) assert type(definitions) is list assert all([d['type'] == item_type for d in definitions]) assert any([d['version'] == [2021, 11, 10] for d in definitions]) + response = client.get('/licenses/CC0-1.0') + definition = json.loads(response.data.decode()) + assert definition['long_name'] == 'Creative Commons Zero v1.0 Universal' + assert definition['source_name'] == 'hello' + + response = client.get('/licenses/random-bad-identifier') + assert response.status_code == 404 + def test_normalize_version(): assert pydrilla.normalize_version([4, 5, 3, 0, 0]) == [4, 5, 3] assert pydrilla.normalize_version([1, 0, 5, 0]) == [1, 0, 5] |