summaryrefslogtreecommitdiff
path: root/src/test/test_pydrilla.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-11-17 12:17:59 +0100
committerWojtek Kosior <koszko@koszko.org>2021-11-17 12:17:59 +0100
commitc00ed7f9ef28f6aee946e168a535d7f637fe46ae (patch)
tree37c5abde4238b2fcf6f1907dbafd7e45ddf98984 /src/test/test_pydrilla.py
parent30d5ada11fc5ffaa0b19f8730631f4d001696d61 (diff)
downloadhaketilo-hydrilla-c00ed7f9ef28f6aee946e168a535d7f637fe46ae.tar.gz
haketilo-hydrilla-c00ed7f9ef28f6aee946e168a535d7f637fe46ae.zip
add source index.json contents fetching
Diffstat (limited to 'src/test/test_pydrilla.py')
-rw-r--r--src/test/test_pydrilla.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/test/test_pydrilla.py b/src/test/test_pydrilla.py
index 89b499f..9ec6ba6 100644
--- a/src/test/test_pydrilla.py
+++ b/src/test/test_pydrilla.py
@@ -75,12 +75,22 @@ def test_api_basic(client):
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['type'] == 'license'
+ 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
+ response = client.get('/sources/hello')
+ definition = json.loads(response.data.decode())
+
+ assert definition['source_name'] == 'hello'
+ assert type(definition['schema_version']) is list
+
+ response = client.get('/sources/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]