Skip to content

Commit

Permalink
Add 1 more test case for CoordinateMapping.__repr__
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Sep 20, 2024
1 parent c59e1ff commit 10112f3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,13 @@ def test_coordinate_mapping_repr():
mapping_4.extend(2, 3, 1)
mapping_4.extend(3, 4, 2)

mapping_5 = CoordinateMapping()
mapping_5.extend(2, 3, 1)
mapping_5.extend(3, 4, 2)
mapping_5.extend(None, 4, 3)
mapping_5.extend(4, None, 4)
mapping_5.extend(5, 5, 5)

assert repr(mapping_1) \
== repr(mapping_2) \
== "CoordinateMapping({ 2: 0, 3: 1 }, { 3: 0, 4: 1 })"
Expand All @@ -1019,3 +1026,10 @@ def test_coordinate_mapping_repr():

assert repr(mapping_4) \
== "CoordinateMapping({ 2: 1, 3: 2 }, { 3: 1, 4: 2 })"

assert repr(mapping_5) \
== "CoordinateMapping(" \
"{ 2: 1, 3: 2, 4: 4, 5: 5, None: 3 }" \
", " \
"{ 3: 1, 4: 3, 5: 5, None: 2, None: 4 }" \
")"

0 comments on commit 10112f3

Please sign in to comment.