Skip to content

Commit

Permalink
add BlockKey test
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Apr 11, 2023
1 parent 199ed6e commit e36a4d0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions asdf/_tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,14 @@ def test_minversion():

assert util.minversion(yaml, "3.1")
assert util.minversion("yaml", "3.1")


def test_block_key():
bk = util.BlockKey()
# make sure block key is hashable and can serve as a dictionary key
hash(bk)
d = {bk: 1}
# a new key should produce a different hash than the first
bk2 = util.BlockKey()
d[bk2] = 2
assert len(d) == 2

0 comments on commit e36a4d0

Please sign in to comment.