Skip to content

Commit

Permalink
tests: Update tests for translation related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Feb 25, 2021
1 parent 8c159cd commit 29c425d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 11 additions & 3 deletions tests/test_common_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_dupe_ids_1():
"null_clause": "",
"error_id": None,
"values": [{"path": "records/0/releases"}],
"instance": "[]",
"instance": [],
},
],
),
Expand Down Expand Up @@ -356,7 +356,7 @@ def test_dupe_ids_1():
"null_clause": "",
"error_id": None,
"values": [{"path": "records/0/releases"}],
"instance": "[]",
"instance": [],
},
],
),
Expand Down Expand Up @@ -558,4 +558,12 @@ def test_validation_release_or_record_package(record_pkg, filename, validation_e
del validation_error_json["schema_title"]
validation_error_jsons.append(validation_error_json)

assert validation_error_jsons == validation_error_jsons_expected
def strip_nones(list_of_dicts):
out = []
for a_dict in list_of_dicts:
out.append(
{key: value for key, value in a_dict.items() if value is not None}
)
return out

assert strip_nones(validation_error_jsons) == strip_nones(validation_error_jsons_expected)
8 changes: 4 additions & 4 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def test_basic_1(record_pkg):
assert schema.schema_name == "release-schema.json"
assert schema.pkg_schema_name == "release-package-schema.json"
assert schema.default_version == "1.1"
assert schema.default_schema_host == "https://standard.open-contracting.org/schema/1__1__5/"
assert schema.schema_host == "https://standard.open-contracting.org/schema/1__1__5/"
assert schema.default_schema_host == "https://standard.open-contracting.org/1.1/en/"
assert schema.schema_host == "https://standard.open-contracting.org/1.1/en/"
assert not schema.config.config["cache_all_requests"]


Expand Down Expand Up @@ -59,8 +59,8 @@ def test_pass_config_1(record_pkg):
assert schema.schema_name == "release-schema.json"
assert schema.pkg_schema_name == "release-package-schema.json"
assert schema.default_version == "1.0"
assert schema.default_schema_host == "https://standard.open-contracting.org/schema/1__0__3/"
assert schema.schema_host == "https://standard.open-contracting.org/schema/1__0__3/"
assert schema.default_schema_host == "https://standard.open-contracting.org/1.0/en/"
assert schema.schema_host == "https://standard.open-contracting.org/1.0/en/"
assert not schema.config.config["cache_all_requests"]


Expand Down

0 comments on commit 29c425d

Please sign in to comment.