aboutsummaryrefslogtreecommitdiff
path: root/test/haketilo_test/unit/test_repo_query.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-03-01 11:29:26 +0100
committerWojtek Kosior <koszko@koszko.org>2022-03-04 16:13:35 +0100
commit57ce414ca81682a71288018a4d9001604002ec23 (patch)
treeb94c9c4cc9b5e4f6a12a82ed4f1ce66537f93525 /test/haketilo_test/unit/test_repo_query.py
parent17e66592321d24a51b18019af84cbc664144d2de (diff)
downloadbrowser-extension-57ce414ca81682a71288018a4d9001604002ec23.tar.gz
browser-extension-57ce414ca81682a71288018a4d9001604002ec23.zip
validate repository responses against JSON schemas
* compute_scripts.awk (include_file): don't enforce specific path format on #INCLUDE'd files * .gitmodules, schemas: add Haketilo JSON schemas subrepo * html/install.js (InstallView): import schema validator and run it against downloaded mapping and resource definitions * html/repo_query.js (RepoEntry): import schema validator and run it against obtained query results * test/haketilo_test/unit/test_install.py (test_install_normal_usage, test_install_dialogs): use underscore instead of hyphen in item identifiers * test/haketilo_test/unit/test_install.py (test_install_dialogs): adapt error message test cases to new handling method of invalid JSON instanced * test/haketilo_test/unit/test_repo_query.py (test_repo_query_normal_usage): use underscore instead of hyphen in item identifiers * test/haketilo_test/unit/test_repo_query.py (test_repo_query_messages): use higher sample unsupported schema version to avoid having to modify the test case soon * test/haketilo_test/world_wide_library.py: use underscore instead of hyphen in item identifiers * common/jsonschema.js, common/jsonschema: adapt tdegrunt's jsonschema and include in Haketilo, load schema documents from schemas/
Diffstat (limited to 'test/haketilo_test/unit/test_repo_query.py')
-rw-r--r--test/haketilo_test/unit/test_repo_query.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/haketilo_test/unit/test_repo_query.py b/test/haketilo_test/unit/test_repo_query.py
index c8c4875..177d415 100644
--- a/test/haketilo_test/unit/test_repo_query.py
+++ b/test/haketilo_test/unit/test_repo_query.py
@@ -99,7 +99,7 @@ def test_repo_query_normal_usage(driver, execute_in_page):
assert len(mapping_entries) == 3
- expected_names = ['MAPPING_ABCD', 'MAPPING_ABCD-DEFG-GHIJ', 'MAPPING_A']
+ expected_names = ['MAPPING-ABCD', 'MAPPING-ABCD-DEFG-GHIJ', 'MAPPING-A']
for name, entry in zip(expected_names, mapping_entries):
assert entry['mapping_name'].text == name
@@ -217,7 +217,7 @@ def test_repo_query_messages(driver, execute_in_page, message):
const response = {
ok: true,
status: 200,
- json: {$schema: "https://hydrilla.koszko.org/schemas/api_query_result-3.2.1.schema.json"}
+ json: {$schema: "https://hydrilla.koszko.org/schemas/api_query_result-255.2.1.schema.json"}
};
browser.tabs.sendMessage = () => Promise.resolve(response);
''')