Skip to content

Commit

Permalink
chore: Fix open file errors in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Oct 7, 2024
1 parent 19ae2ec commit e24f318
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions tests/lib/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,18 +1183,23 @@ def common_fixtures(filename):

def test_get_field_coverage_oc4ids():
# Compare the actual json output, to ensure order is the same
assert (
json.dumps(
get_field_coverage(
schema_obj_from_str(
open(common_fixtures("oc4ids_project-schema_0__9__2.json")).read()
with (
open(common_fixtures("oc4ids_example_coverage.json")) as schema_file_with_coverage,
open(common_fixtures("oc4ids_project-schema_0__9__2.json")) as schema_file,
open(common_fixtures("oc4ids_example.json")) as data_file,
):
assert (
json.dumps(
get_field_coverage(
schema_obj_from_str(
schema_file.read()
),
json.load(data_file)["projects"],
),
json.load(open(common_fixtures("oc4ids_example.json")))["projects"],
),
indent=2,
indent=2,
)
== schema_file_with_coverage.read()
)
== open(common_fixtures("oc4ids_example_coverage.json")).read()
)


@pytest.mark.parametrize(
Expand Down

0 comments on commit e24f318

Please sign in to comment.