MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_uuid8_uniqueness

Method test_uuid8_uniqueness

Lib/test/test_uuid.py:1103–1113  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1101 equal(u.int & 0x3fffffffffffffff, lo)
1102
1103 def test_uuid8_uniqueness(self):
1104 # Test that UUIDv8-generated values are unique (up to a negligible
1105 # probability of failure). There are 122 bits of entropy and assuming
1106 # that the underlying mt-19937-based random generator is sufficiently
1107 # good, it is unlikely to have a collision of two UUIDs.
1108 N = 1000
1109 uuids = {self.uuid.uuid8() for _ in range(N)}
1110 self.assertEqual(len(uuids), N)
1111
1112 versions = {u.version for u in uuids}
1113 self.assertSetEqual(versions, {8})
1114
1115 @support.requires_fork()
1116 def testIssue8621(self):

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
assertSetEqualMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected