File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,30 @@ def test_numpy_datetime64(self):
208208 later_hash = DeepHash (later )
209209 assert a_hash [a ] != later_hash [later ]
210210
211+ def test_uuid6_hash_positive (self ):
212+ """Positive test case: Same UUID objects should produce the same hash."""
213+ import uuid6
214+ uuid_obj = uuid6 .uuid7 ()
215+ hash1 = DeepHash (uuid_obj )
216+ hash2 = DeepHash (uuid_obj )
217+ assert hash1 [uuid_obj ] == hash2 [uuid_obj ]
218+
219+ import uuid
220+ regular_uuid = uuid .uuid4 ()
221+ hash_regular = DeepHash (regular_uuid )
222+ assert hash_regular [regular_uuid ] is not unprocessed
223+
224+ def test_uuid6_deepdiff_negative (self ):
225+ """Negative test case: DeepDiff should detect differences between sets containing different UUID objects."""
226+ import uuid6
227+ dummy_id_1 = uuid6 .uuid7 ()
228+ dummy_id_2 = uuid6 .uuid7 ()
229+ set1 = {dummy_id_1 }
230+ set2 = {dummy_id_1 , dummy_id_2 }
231+ diff = DeepDiff (set1 , set2 )
232+ assert diff != {}
233+ assert 'set_item_added' in diff
234+ assert str (dummy_id_2 ) in str (diff )
211235
212236class TestDeepHashPrep :
213237 """DeepHashPrep Tests covering object serialization."""
You can’t perform that action at this time.
0 commit comments