Lines Matching full:uuid
13 py_uuid = support.import_fresh_module('uuid', blocked=['_uuid'])
14 c_uuid = support.import_fresh_module('uuid', fresh=['_uuid'])
26 uuid = None variable in BaseTestUUID
40 'urn:uuid:00000000-0000-0000-0000-000000000000',
41 0, 0, self.uuid.RESERVED_NCS, None),
49 'urn:uuid:00010203-0405-0607-0809-0a0b0c0d0e0f',
50 0x607040500010203, 0x809, self.uuid.RESERVED_NCS, None),
58 'urn:uuid:02d9e6d5-9467-382e-8f9b-9300a64ac3cd',
59 0x82e946702d9e6d5, 0xf9b, self.uuid.RFC_4122, 3),
67 'urn:uuid:12345678-1234-5678-1234-567812345678',
68 0x678123412345678, 0x1234, self.uuid.RESERVED_NCS, None),
76 'urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8',
77 0x1d19dad6ba7b810, 0xb4, self.uuid.RFC_4122, 1),
85 'urn:uuid:6ba7b811-9dad-11d1-80b4-00c04fd430c8',
86 0x1d19dad6ba7b811, 0xb4, self.uuid.RFC_4122, 1),
94 'urn:uuid:6ba7b812-9dad-11d1-80b4-00c04fd430c8',
95 0x1d19dad6ba7b812, 0xb4, self.uuid.RFC_4122, 1),
103 'urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8',
104 0x1d19dad6ba7b814, 0xb4, self.uuid.RFC_4122, 1),
112 'urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2',
113 0x1d19dc07d444840, 0x3245, self.uuid.RFC_4122, 1),
121 'urn:uuid:e902893a-9d22-3c7e-a7b8-d6e313b71d9f',
122 0xc7e9d22e902893a, 0x27b8, self.uuid.RFC_4122, 3),
130 'urn:uuid:eb424026-6f54-4ef8-a4d0-bb658a1fc6cf',
131 0xef86f54eb424026, 0x24d0, self.uuid.RFC_4122, 4),
139 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
140 0x1d07decf81d4fae, 0x2765, self.uuid.RFC_4122, 1),
148 'urn:uuid:fffefdfc-fffe-fffe-fffe-fffefdfcfbfa',
149 0xffefffefffefdfc, 0x3ffe, self.uuid.RESERVED_FUTURE, None),
157 'urn:uuid:ffffffff-ffff-ffff-ffff-ffffffffffff',
158 0xfffffffffffffff, 0x3fff, self.uuid.RESERVED_FUTURE, None),
161 # Construct each UUID in several different ways.
162 for u in [self.uuid.UUID(string), self.uuid.UUID(curly), self.uuid.UUID(hex),
163 self.uuid.UUID(bytes=bytes), self.uuid.UUID(bytes_le=bytes_le),
164 self.uuid.UUID(fields=fields), self.uuid.UUID(int=integer),
165 self.uuid.UUID(urn)]:
166 # Test all conversions and properties of the UUID object.
187 # Different construction methods should give the same UUID.
219 badvalue(lambda: self.uuid.UUID(''))
220 badvalue(lambda: self.uuid.UUID('abc'))
221 badvalue(lambda: self.uuid.UUID('1234567812345678123456781234567'))
222 badvalue(lambda: self.uuid.UUID('123456781234567812345678123456789'))
223 badvalue(lambda: self.uuid.UUID('123456781234567812345678z2345678'))
226 badvalue(lambda: self.uuid.UUID(bytes='abc'))
227 badvalue(lambda: self.uuid.UUID(bytes='\0'*15))
228 badvalue(lambda: self.uuid.UUID(bytes='\0'*17))
231 badvalue(lambda: self.uuid.UUID(bytes_le='abc'))
232 badvalue(lambda: self.uuid.UUID(bytes_le='\0'*15))
233 badvalue(lambda: self.uuid.UUID(bytes_le='\0'*17))
236 badvalue(lambda: self.uuid.UUID(fields=(1,)))
237 badvalue(lambda: self.uuid.UUID(fields=(1, 2, 3, 4, 5)))
238 badvalue(lambda: self.uuid.UUID(fields=(1, 2, 3, 4, 5, 6, 7)))
241 badvalue(lambda: self.uuid.UUID(fields=(-1, 0, 0, 0, 0, 0)))
242 badvalue(lambda: self.uuid.UUID(fields=(0x100000000, 0, 0, 0, 0, 0)))
243 badvalue(lambda: self.uuid.UUID(fields=(0, -1, 0, 0, 0, 0)))
244 badvalue(lambda: self.uuid.UUID(fields=(0, 0x10000, 0, 0, 0, 0)))
245 badvalue(lambda: self.uuid.UUID(fields=(0, 0, -1, 0, 0, 0)))
246 badvalue(lambda: self.uuid.UUID(fields=(0, 0, 0x10000, 0, 0, 0)))
247 badvalue(lambda: self.uuid.UUID(fields=(0, 0, 0, -1, 0, 0)))
248 badvalue(lambda: self.uuid.UUID(fields=(0, 0, 0, 0x100, 0, 0)))
249 badvalue(lambda: self.uuid.UUID(fields=(0, 0, 0, 0, -1, 0)))
250 badvalue(lambda: self.uuid.UUID(fields=(0, 0, 0, 0, 0x100, 0)))
251 badvalue(lambda: self.uuid.UUID(fields=(0, 0, 0, 0, 0, -1)))
252 badvalue(lambda: self.uuid.UUID(fields=(0, 0, 0, 0, 0, 0x1000000000000)))
255 badvalue(lambda: self.uuid.UUID('00'*16, version=0))
256 badvalue(lambda: self.uuid.UUID('00'*16, version=6))
259 badvalue(lambda: self.uuid.UUID(int=-1))
260 badvalue(lambda: self.uuid.UUID(int=1<<128))
264 self.uuid.UUID(h)
265 self.uuid.UUID(hex=h)
266 self.uuid.UUID(bytes=b)
267 self.uuid.UUID(bytes_le=b)
268 self.uuid.UUID(fields=f)
269 self.uuid.UUID(int=i)
272 badtype(lambda: self.uuid.UUID())
273 badtype(lambda: self.uuid.UUID(h, b))
274 badtype(lambda: self.uuid.UUID(h, b, b))
275 badtype(lambda: self.uuid.UUID(h, b, b, f))
276 badtype(lambda: self.uuid.UUID(h, b, b, f, i))
286 badtype(lambda: self.uuid.UUID(h, **args))
288 badtype(lambda: self.uuid.UUID(**args))
291 u = self.uuid.UUID(h)
305 # Comparison with a non-UUID object
310 node1 = self.uuid.getnode()
314 node2 = self.uuid.getnode()
322 with support.swap_item(sys.modules, 'uuid', self.uuid):
323 for is_safe in self.uuid.SafeUUID:
324 u = self.uuid.UUID('d82579ce6642a0de7ddf490a7aec7aa5',
434 u = self.uuid.UUID('d82579ce6642a0de7ddf490a7aec7aa5')
435 u_safe = self.uuid.UUID('d82579ce6642a0de7ddf490a7aec7aa5',
436 is_safe=self.uuid.SafeUUID.safe)
437 u_unsafe = self.uuid.UUID('d82579ce6642a0de7ddf490a7aec7aa5',
438 is_safe=self.uuid.SafeUUID.unsafe)
440 with support.swap_item(sys.modules, 'uuid', self.uuid):
454 # Confirm that uuid.getnode ignores hardware addresses larger than 48
457 # uuid.getnode to fall back on uuid._random_getnode, which will
461 self.uuid,
466 node = self.uuid.getnode()
470 # uuid.getnode fell back on uuid._random_getnode() rather than using
473 self.uuid.uuid1(node=node)
481 for u in [self.uuid.uuid1() for i in range(10)]:
482 equal(u.variant, self.uuid.RFC_4122)
484 self.assertIn(u.is_safe, {self.uuid.SafeUUID.safe,
485 self.uuid.SafeUUID.unsafe,
486 self.uuid.SafeUUID.unknown})
490 for u in [self.uuid.uuid1() for i in range(1000)]:
494 # Make sure the supplied node ID appears in the UUID.
495 u = self.uuid.uuid1(0)
497 u = self.uuid.uuid1(0x123456789abc)
499 u = self.uuid.uuid1(0xffffffffffff)
502 # Make sure the supplied clock sequence appears in the UUID.
503 u = self.uuid.uuid1(0x123456789abc, 0)
506 u = self.uuid.uuid1(0x123456789abc, 0x1234)
510 u = self.uuid.uuid1(0x123456789abc, 0x3fff)
515 # bpo-29925: On Mac OS X Tiger, self.uuid.uuid1().is_safe returns
516 # self.uuid.SafeUUID.unknown
520 if not self.uuid._has_uuid_generate_time_safe:
523 u = self.uuid.uuid1()
527 self.assertNotEqual(u.is_safe, self.uuid.SafeUUID.unknown)
532 Mock uuid._generate_time_safe() to return a given *safe_value*.
536 self.uuid._load_system_functions()
537 f = self.uuid._generate_time_safe
539 self.skipTest('need uuid._generate_time_safe')
540 with unittest.mock.patch.object(self.uuid, '_generate_time_safe',
549 u = self.uuid.uuid1()
550 self.assertEqual(u.is_safe, self.uuid.SafeUUID.unknown)
555 u = self.uuid.uuid1()
556 self.assertEqual(u.is_safe, self.uuid.SafeUUID.safe)
561 u = self.uuid.uuid1()
562 self.assertEqual(u.is_safe, self.uuid.SafeUUID.unsafe)
567 u = self.uuid.uuid1()
568 self.assertEqual(u.is_safe, self.uuid.SafeUUID.unknown)
574 for u, v in [(self.uuid.uuid3(self.uuid.NAMESPACE_DNS, 'python.org'),
576 (self.uuid.uuid3(self.uuid.NAMESPACE_URL, 'http://python.org/'),
578 (self.uuid.uuid3(self.uuid.NAMESPACE_OID, '1.3.6.1'),
580 (self.uuid.uuid3(self.uuid.NAMESPACE_X500, 'c=ca'),
583 equal(u.variant, self.uuid.RFC_4122)
585 equal(u, self.uuid.UUID(v))
592 for u in [self.uuid.uuid4() for i in range(10)]:
593 equal(u.variant, self.uuid.RFC_4122)
598 for u in [self.uuid.uuid4() for i in range(1000)]:
606 for u, v in [(self.uuid.uuid5(self.uuid.NAMESPACE_DNS, 'python.org'),
608 (self.uuid.uuid5(self.uuid.NAMESPACE_URL, 'http://python.org/'),
610 (self.uuid.uuid5(self.uuid.NAMESPACE_OID, '1.3.6.1'),
612 (self.uuid.uuid5(self.uuid.NAMESPACE_X500, 'c=ca'),
615 equal(u.variant, self.uuid.RFC_4122)
617 equal(u, self.uuid.UUID(v))
622 # On at least some versions of OSX self.uuid.uuid4 generates
629 value = self.uuid.uuid4()
636 parent_value = self.uuid.uuid4().hex
644 uuid = py_uuid variable in TestUUIDWithoutExtModule
648 uuid = c_uuid variable in TestUUIDWithExtModule
652 uuid = None variable in BaseTestInternals
669 mac = self.uuid._find_mac(
689 node = self.uuid._ifconfig_getnode()
694 node = self.uuid._ip_getnode()
699 node = self.uuid._arp_getnode()
704 node = self.uuid._lanscan_getnode()
709 node = self.uuid._netstat_getnode()
714 node = self.uuid._ipconfig_getnode()
720 node = self.uuid._netbios_getnode()
724 node = self.uuid._random_getnode()
731 node2 = self.uuid._random_getnode()
739 node = self.uuid._unix_getnode()
747 node = self.uuid._windll_getnode()
752 uuid = py_uuid variable in TestInternalsWithoutExtModule
756 uuid = c_uuid variable in TestInternalsWithExtModule