Skip to content

Commit

Permalink
Update expected test results #512 #515
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Aug 13, 2024
1 parent ab4b9d7 commit 59e9e0e
Show file tree
Hide file tree
Showing 2 changed files with 376 additions and 192 deletions.
14 changes: 6 additions & 8 deletions packagedb/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,18 +977,16 @@ def test_package_live(self):
1, Package.objects.filter(download_url=sources_download_url).count()
)
expected = self.get_test_loc("api/twill-core-0.12.0.json")

self.assertEqual(2, len(response.data))
# Sort results by name
results = sorted(response.data, key=lambda x: x["name"])
result = results[0]
results = response.data
self.assertEqual(2, len(results))

# remove fields
result.pop("url")
fields_to_remove = ["uuid", "resources", "package_sets", "history"]
for result in results:
result.pop("url")

fields_to_remove = ["uuid", "resources", "package_sets", "history"]
self.check_expected_results(
result, expected, fields_to_remove=fields_to_remove, regen=FIXTURES_REGEN
results, expected, fields_to_remove=fields_to_remove, regen=FIXTURES_REGEN
)

# Ensure that the created ScannableURI objects have a priority of 100
Expand Down
Loading

0 comments on commit 59e9e0e

Please sign in to comment.