summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--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)