aboutsummaryrefslogtreecommitdiff
path: root/doc/man/man1
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-05-31 21:27:41 +0200
committerWojtek Kosior <koszko@koszko.org>2022-05-31 21:27:41 +0200
commit117bf196e195c758ca53fda3f9ab974767bfa90c (patch)
tree59b89596d0d9392c097e62d66db25bad0bb14954 /doc/man/man1
parent7d272015600718162547f78befa42bf71a81984e (diff)
downloadhydrilla-builder-117bf196e195c758ca53fda3f9ab974767bfa90c.tar.gz
hydrilla-builder-117bf196e195c758ca53fda3f9ab974767bfa90c.zip
add test case for unknown schema version error
Diffstat (limited to 'doc/man/man1')
0 files changed, 0 insertions, 0 deletions
mp;id=a1704a27055df09c41700f60d5293ec68c0c1d4c'>src/test/test_server.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/test/test_server.py b/src/test/test_server.py
index b283a00..f7dc06e 100644
--- a/src/test/test_server.py
+++ b/src/test/test_server.py
@@ -39,12 +39,17 @@ from markupsafe import escape
from hydrilla import util as hydrilla_util
from hydrilla.builder import Build
-from hydrilla.server import HydrillaApp, config
+from hydrilla.server import HydrillaApp, config, _version
here = Path(__file__).resolve().parent
config_path = here / 'config.json'
source_path = here / 'source-package-example'
+expected_generated_by = {
+ 'name': 'hydrilla.server',
+ 'version': _version.version
+}
+
@pytest.fixture(scope="session")
def default_setup() -> Iterable[dict[str, Path]]:
with TemporaryDirectory() as tmpdir:
@@ -141,7 +146,11 @@ def test_empty_query(client: FlaskClient) -> None:
response_object = json.loads(response.data.decode())
- assert response_object['mappings'] == []
+ assert response_object == {
+ 'api_schema_version': [1],
+ 'mappings': [],
+ 'generated_by': expected_generated_by
+ }
hydrilla_util.validator_for('api_query_result-1.schema.json')\
.validate(response_object)
@@ -156,11 +165,15 @@ def test_query(client: FlaskClient) -> None:
response_object = json.loads(response.data.decode())
- assert response_object['mappings'] == [{
- 'identifier': 'helloapple',
- 'long_name': 'Hello Apple',
- 'version': [2021, 11, 10]
- }]
+ assert response_object == {
+ 'api_schema_version': [1],
+ 'mappings': [{
+ 'identifier': 'helloapple',
+ 'long_name': 'Hello Apple',
+ 'version': [2021, 11, 10]
+ }],
+ 'generated_by': expected_generated_by
+ }
hydrilla_util.validator_for('api_query_result-1.schema.json')\
.validate(response_object)