(self)
| 928 | equal(u.int & 0xffff_ffff, tail) |
| 929 | |
| 930 | def test_uuid7_uniqueness(self): |
| 931 | # Test that UUIDv7-generated values are unique. |
| 932 | # |
| 933 | # While UUIDv8 has an entropy of 122 bits, those 122 bits may not |
| 934 | # necessarily be sampled from a PRNG. On the other hand, UUIDv7 |
| 935 | # uses os.urandom() as a PRNG which features better randomness. |
| 936 | N = 1000 |
| 937 | uuids = {self.uuid.uuid7() for _ in range(N)} |
| 938 | self.assertEqual(len(uuids), N) |
| 939 | |
| 940 | versions = {u.version for u in uuids} |
| 941 | self.assertSetEqual(versions, {7}) |
| 942 | |
| 943 | def test_uuid7_monotonicity(self): |
| 944 | equal = self.assertEqual |
nothing calls this directly
no test coverage detected