diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_pydrilla.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/test_pydrilla.py b/src/test/test_pydrilla.py index 660c8f3..db9a321 100644 --- a/src/test/test_pydrilla.py +++ b/src/test/test_pydrilla.py @@ -99,6 +99,17 @@ def test_api_basic(client, development_config): response = client.get('/sources/random-bad-identifier') assert response.status_code == 404 + response = client.get('/query?url=https://hachettebugs.koszko.org') + definitions = json.loads(response.data.decode()) + assert type(definitions) is list + assert all([d['type'] == 'mapping' for d in definitions]) + assert any([p['pattern'] == 'https://hachettebugs.koszko.org/***' + for d in definitions for p in d['payloads']]) + + response = client.get('/query?url=https://random_bad_domain.org/something') + definitions = json.loads(response.data.decode()) + assert definitions == [] + 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] |