From 2915cb8bb6f1d6e5514b5c5688b1d622595790cf Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Wed, 4 Mar 2026 00:22:50 +0800 Subject: [PATCH] Add test for UUID hash --- tests/core_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/core_test.py b/tests/core_test.py index 02ebbaa..0d9f980 100644 --- a/tests/core_test.py +++ b/tests/core_test.py @@ -73,6 +73,14 @@ def test_uuid_to_hex_str() -> None: ) +# ----------------------------------------------------------------------------- +def test_uuid_hash() -> None: + uuid = UUID("1234") + uuid_128_bytes = UUID.from_bytes(uuid.to_bytes(force_128=True)) + assert uuid in {uuid_128_bytes} + assert uuid_128_bytes in {uuid} + + # ----------------------------------------------------------------------------- def test_appearance() -> None: a = Appearance(Appearance.Category.COMPUTER, Appearance.ComputerSubcategory.LAPTOP)