Skip to content

Commit 78a961d

Browse files
committed
add: test enum checksum.
1 parent 04f3852 commit 78a961d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/test_checksum.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ def test_sets(self) -> None:
5757
assert s1 == s2
5858
assert checksum_any(s1) == checksum_any(s2)
5959

60+
def test_enums(self) -> None:
61+
from enum import Enum
62+
63+
class Color(Enum):
64+
RED = 1
65+
GREEN = 2
66+
BLUE = 3
67+
ROUGE = RED
68+
69+
c1 = Color.RED
70+
c2 = Color.GREEN
71+
assert c1 != c2
72+
assert checksum_any(c1) != checksum_any(c2)
73+
74+
assert Color.RED == Color.ROUGE
75+
assert checksum_any(Color.RED) == checksum_any(Color.ROUGE)
76+
6077

6178
if __name__ == "__main__":
6279
unittest.main()

0 commit comments

Comments
 (0)