Skip to content

Commit

Permalink
test: Test URDFModel hashing capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
iwishiwasaneagle committed Apr 26, 2023
1 parent a0a207f commit ebfbcba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,14 @@ def test_as_str_list_fail():
"P3",
)[::-1]
)


def test_URDFModel_hashing(urdfmodel):
assert hash(urdfmodel) is not None
assert hash(urdfmodel) == hash(urdfmodel)

urdfmodel.g = 0
hash1 = hash(urdfmodel)
urdfmodel.g += 1
hash2 = hash(urdfmodel)
assert hash1 != hash2

0 comments on commit ebfbcba

Please sign in to comment.