Skip to content

Commit

Permalink
Format expected json
Browse files Browse the repository at this point in the history
  • Loading branch information
elic-eon committed Oct 1, 2024
1 parent f77be1e commit 30a7114
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/mongodb/test_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ def get_dataset_name(dataset: Dataset):

trimmed_datasets = [EventUtil.trim_event(ds) for ds in datasets]
expected = f"{test_root_dir}/mongodb/expected_datasets.json"
assert trimmed_datasets == load_json(expected, trimmed_datasets)
assert trimmed_datasets == load_json(expected)
3 changes: 2 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def load_json(path, events: Optional[List[Dict[str, Any]]] = None):
"""
if events:
with open(path, "w") as f:
f.write(json.dumps(events, indent=4))
f.write(json.dumps(events, indent=2, sort_keys=True))
f.write("\n")
with open(path, "r") as f:
return json.load(f)

Expand Down

0 comments on commit 30a7114

Please sign in to comment.