Skip to content

Commit

Permalink
double check correct resulting raw
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Jun 16, 2024
1 parent 055786c commit 4f99b1a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_atproto_client/models/tests/test_blob_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ def test_blob_ref_to_ipld() -> None:
assert blob_ref2 == blob_ref
assert blob_ref2.ref == blob_ref.ref

# verify RAW ref representation
blob_ref2_raw = get_model_as_dict(blob_ref)
assert isinstance(blob_ref2_raw['ref'], str)
assert plain_cid == blob_ref2_raw['ref']


def test_blob_ref_to_ipld_json() -> None:
plain_cid = 'bafyreidfayvfuwqa7qlnopdjiqrxzs6blmoeu4rujcjtnci5beludirz2a'
Expand All @@ -88,3 +93,8 @@ def test_blob_ref_to_ipld_json() -> None:
assert blob_ref2 == blob_ref
assert blob_ref2.ref == blob_ref.ref
assert blob_ref2.ref.link == blob_ref.ref.link

# verify JSON ref representation
blob_ref2_raw = get_model_as_dict(blob_ref)
assert '$link' in blob_ref2_raw['ref']
assert plain_cid == blob_ref2_raw['ref']['$link']

0 comments on commit 4f99b1a

Please sign in to comment.