Skip to content

Commit

Permalink
Change row sorting in JSONL manifest test
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc committed Apr 22, 2024
1 parent f3d7229 commit 5199c21
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/service/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
)
from azul.json import (
copy_json,
json_hash,
)
from azul.logging import (
configure_test_logging,
Expand Down Expand Up @@ -1309,12 +1310,8 @@ def test_verbatim_jsonl_manifest(self):
self.assertEqual(200, response.status_code)
response = list(map(json.loads, response.content.decode().splitlines()))

def sort_key(hca_doc: JSON) -> str:
try:
return hca_doc['provenance']['document_id']
except KeyError:
assert hca_doc['schema_type'] == 'link_bundle'
return ''
def sort_key(row: JSON) -> bytes:
return json_hash(row).digest()

expected.sort(key=sort_key)
response.sort(key=sort_key)
Expand Down

0 comments on commit 5199c21

Please sign in to comment.