Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #11 from CybercentreCanada/update/remove_test_json
Browse files Browse the repository at this point in the history
Removing result json from unit test [dev]
  • Loading branch information
cccs-kevin authored May 31, 2022
2 parents 0eb20f7 + 9d14bb6 commit 88f796a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.

This file was deleted.

25 changes: 0 additions & 25 deletions tests/test_intezer_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,31 +278,6 @@ def test_execute(sample, intezer_static_class_instance, dummy_api_interface_clas
# Actually executing the sample
intezer_static_class_instance.execute(service_request)

# Get the result of execute() from the test method
test_result = task.get_service_result()

# Get the assumed "correct" result of the sample
correct_result_path = os.path.join(TEST_DIR, "results", task.file_name + ".json")
with open(correct_result_path, "r") as f:
correct_result = loads(f.read())
f.close()

# Assert that the appropriate sections of the dict are equal

# Avoiding unique items in the response
test_result_response = test_result.pop("response")
correct_result_response = correct_result.pop("response")
assert test_result == correct_result

# Comparing everything in the response except for the service_completed and the output.json supplementary
test_result_response["milestones"].pop("service_completed")
correct_result_response["milestones"].pop("service_completed")
correct_result_response.pop("supplementary")
test_result_response.pop("supplementary")
correct_result_response.pop("service_context")
test_result_response.pop("service_context")
assert test_result_response == correct_result_response

# Code coverage
task.service_config = {
"analysis_id": "blah",
Expand Down

0 comments on commit 88f796a

Please sign in to comment.