Lines Matching full:uuid

5 import uuid
27 'urn:uuid:00000000-0000-0000-0000-000000000000',
28 0, 0, uuid.RESERVED_NCS, None),
36 'urn:uuid:00010203-0405-0607-0809-0a0b0c0d0e0f',
37 0x607040500010203L, 0x809, uuid.RESERVED_NCS, None),
45 'urn:uuid:02d9e6d5-9467-382e-8f9b-9300a64ac3cd',
46 0x82e946702d9e6d5L, 0xf9b, uuid.RFC_4122, 3),
54 'urn:uuid:12345678-1234-5678-1234-567812345678',
55 0x678123412345678L, 0x1234, uuid.RESERVED_NCS, None),
63 'urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8',
64 0x1d19dad6ba7b810L, 0xb4, uuid.RFC_4122, 1),
72 'urn:uuid:6ba7b811-9dad-11d1-80b4-00c04fd430c8',
73 0x1d19dad6ba7b811L, 0xb4, uuid.RFC_4122, 1),
81 'urn:uuid:6ba7b812-9dad-11d1-80b4-00c04fd430c8',
82 0x1d19dad6ba7b812L, 0xb4, uuid.RFC_4122, 1),
90 'urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8',
91 0x1d19dad6ba7b814L, 0xb4, uuid.RFC_4122, 1),
99 'urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2',
100 0x1d19dc07d444840L, 0x3245, uuid.RFC_4122, 1),
108 'urn:uuid:e902893a-9d22-3c7e-a7b8-d6e313b71d9f',
109 0xc7e9d22e902893aL, 0x27b8, uuid.RFC_4122, 3),
117 'urn:uuid:eb424026-6f54-4ef8-a4d0-bb658a1fc6cf',
118 0xef86f54eb424026L, 0x24d0, uuid.RFC_4122, 4),
126 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
127 0x1d07decf81d4faeL, 0x2765, uuid.RFC_4122, 1),
135 'urn:uuid:fffefdfc-fffe-fffe-fffe-fffefdfcfbfa',
136 0xffefffefffefdfcL, 0x3ffe, uuid.RESERVED_FUTURE, None),
144 'urn:uuid:ffffffff-ffff-ffff-ffff-ffffffffffff',
145 0xfffffffffffffffL, 0x3fff, uuid.RESERVED_FUTURE, None),
148 # Construct each UUID in several different ways.
149 for u in [uuid.UUID(string), uuid.UUID(curly), uuid.UUID(hex),
150 uuid.UUID(bytes=bytes), uuid.UUID(bytes_le=bytes_le),
151 uuid.UUID(fields=fields), uuid.UUID(int=integer),
152 uuid.UUID(urn)]:
153 # Test all conversions and properties of the UUID object.
174 # Different construction methods should give the same UUID.
196 badvalue(lambda: uuid.UUID(''))
197 badvalue(lambda: uuid.UUID('abc'))
198 badvalue(lambda: uuid.UUID('1234567812345678123456781234567'))
199 badvalue(lambda: uuid.UUID('123456781234567812345678123456789'))
200 badvalue(lambda: uuid.UUID('123456781234567812345678z2345678'))
203 badvalue(lambda: uuid.UUID(bytes='abc'))
204 badvalue(lambda: uuid.UUID(bytes='\0'*15))
205 badvalue(lambda: uuid.UUID(bytes='\0'*17))
208 badvalue(lambda: uuid.UUID(bytes_le='abc'))
209 badvalue(lambda: uuid.UUID(bytes_le='\0'*15))
210 badvalue(lambda: uuid.UUID(bytes_le='\0'*17))
213 badvalue(lambda: uuid.UUID(fields=(1,)))
214 badvalue(lambda: uuid.UUID(fields=(1, 2, 3, 4, 5)))
215 badvalue(lambda: uuid.UUID(fields=(1, 2, 3, 4, 5, 6, 7)))
218 badvalue(lambda: uuid.UUID(fields=(-1, 0, 0, 0, 0, 0)))
219 badvalue(lambda: uuid.UUID(fields=(0x100000000L, 0, 0, 0, 0, 0)))
220 badvalue(lambda: uuid.UUID(fields=(0, -1, 0, 0, 0, 0)))
221 badvalue(lambda: uuid.UUID(fields=(0, 0x10000L, 0, 0, 0, 0)))
222 badvalue(lambda: uuid.UUID(fields=(0, 0, -1, 0, 0, 0)))
223 badvalue(lambda: uuid.UUID(fields=(0, 0, 0x10000L, 0, 0, 0)))
224 badvalue(lambda: uuid.UUID(fields=(0, 0, 0, -1, 0, 0)))
225 badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0x100L, 0, 0)))
226 badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, -1, 0)))
227 badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, 0x100L, 0)))
228 badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, 0, -1)))
229 badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, 0, 0x1000000000000L)))
232 badvalue(lambda: uuid.UUID('00'*16, version=0))
233 badvalue(lambda: uuid.UUID('00'*16, version=6))
236 badvalue(lambda: uuid.UUID(int=-1))
237 badvalue(lambda: uuid.UUID(int=1<<128L))
241 uuid.UUID(h)
242 uuid.UUID(hex=h)
243 uuid.UUID(bytes=b)
244 uuid.UUID(bytes_le=b)
245 uuid.UUID(fields=f)
246 uuid.UUID(int=i)
249 badtype(lambda: uuid.UUID())
250 badtype(lambda: uuid.UUID(h, b))
251 badtype(lambda: uuid.UUID(h, b, b))
252 badtype(lambda: uuid.UUID(h, b, b, f))
253 badtype(lambda: uuid.UUID(h, b, b, f, i))
263 badtype(lambda: uuid.UUID(h, **args))
265 badtype(lambda: uuid.UUID(**args))
268 u = uuid.UUID(h)
283 node1 = uuid.getnode()
287 node2 = uuid.getnode()
293 # Confirm that uuid.getnode ignores hardware addresses larger than 48
296 # uuid.getnode to fall back on uuid._random_getnode, which will
300 uuid_real__node = uuid._node
301 uuid_real__NODE_GETTERS_WIN32 = uuid._NODE_GETTERS_WIN32
302 uuid_real__NODE_GETTERS_UNIX = uuid._NODE_GETTERS_UNIX
303 uuid._node = None
304 uuid._NODE_GETTERS_WIN32 = [too_large_getter]
305 uuid._NODE_GETTERS_UNIX = [too_large_getter]
307 node = uuid.getnode()
309 uuid._node = uuid_real__node
310 uuid._NODE_GETTERS_WIN32 = uuid_real__NODE_GETTERS_WIN32
311 uuid._NODE_GETTERS_UNIX = uuid_real__NODE_GETTERS_UNIX
316 # uuid.getnode fell back on uuid._random_getnode() rather than using
319 uuid.uuid1(node=node)
328 for u in [uuid.uuid1() for i in range(10)]:
329 equal(u.variant, uuid.RFC_4122)
334 for u in [uuid.uuid1() for i in range(1000)]:
338 # Make sure the supplied node ID appears in the UUID.
339 u = uuid.uuid1(0)
341 u = uuid.uuid1(0x123456789abc)
343 u = uuid.uuid1(0xffffffffffff)
346 # Make sure the supplied clock sequence appears in the UUID.
347 u = uuid.uuid1(0x123456789abc, 0)
350 u = uuid.uuid1(0x123456789abc, 0x1234)
354 u = uuid.uuid1(0x123456789abc, 0x3fff)
363 for u, v in [(uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org'),
365 (uuid.uuid3(uuid.NAMESPACE_URL, 'http://python.org/'),
367 (uuid.uuid3(uuid.NAMESPACE_OID, '1.3.6.1'),
369 (uuid.uuid3(uuid.NAMESPACE_X500, 'c=ca'),
372 equal(u.variant, uuid.RFC_4122)
374 equal(u, uuid.UUID(v))
382 for u in [uuid.uuid4() for i in range(10)]:
383 equal(u.variant, uuid.RFC_4122)
388 for u in [uuid.uuid4() for i in range(1000)]:
396 for u, v in [(uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org'),
398 (uuid.uuid5(uuid.NAMESPACE_URL, 'http://python.org/'),
400 (uuid.uuid5(uuid.NAMESPACE_OID, '1.3.6.1'),
402 (uuid.uuid5(uuid.NAMESPACE_X500, 'c=ca'),
405 equal(u.variant, uuid.RFC_4122)
407 equal(u, uuid.UUID(v))
412 # On at least some versions of OSX uuid.uuid4 generates
419 value = uuid.uuid4()
426 parent_value = uuid.uuid4().hex
457 mac = uuid._find_mac(
476 node = uuid._ifconfig_getnode()
481 node = uuid._arp_getnode()
486 node = uuid._lanscan_getnode()
491 node = uuid._netstat_getnode()
496 node = uuid._ipconfig_getnode()
502 node = uuid._netbios_getnode()
506 node = uuid._random_getnode()
517 node = uuid._unixdll_getnode()
525 node = uuid._windll_getnode()