Fixed some Python2.4 issues in ipauuid.py doctests

This commit is contained in:
Jason Gerard DeRose
2009-01-21 13:08:30 -07:00
parent 5616af19b1
commit c4702f3a1e
+13 -13
View File
@@ -10,37 +10,37 @@ the computer's network address. uuid4() creates a random UUID.
Typical usage:
>>> import uuid
>>> from ipalib import uuid
# make a UUID based on the host ID and current time
>>> uuid.uuid1() #doctest: +SKIP
UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')
>>> uuid.uuid1() #doctest: +ELLIPSIS
UUID('...')
# make a UUID using an MD5 hash of a namespace UUID and a name
>>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org') #doctest: +SKIP
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
>>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org') #doctest: +ELLIPSIS
UUID('...')
# make a random UUID
>>> uuid.uuid4() #doctest: +SKIP
UUID('16fd2706-8baf-433b-82eb-8c7fada847da')
>>> uuid.uuid4() #doctest: +ELLIPSIS
UUID('...')
# make a UUID using a SHA-1 hash of a namespace UUID and a name
>>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') #doctest: +SKIP
UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')
>>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') #doctest: +ELLIPSIS
UUID('...')
# make a UUID from a string of hex digits (braces and hyphens ignored)
>>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}') #doctest: +SKIP
>>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')
# convert a UUID to a string of hex digits in standard form
>>> str(x) #doctest: +SKIP
>>> str(x)
'00010203-0405-0607-0809-0a0b0c0d0e0f'
# get the raw 16 bytes of the UUID
>>> x.bytes #doctest: +SKIP
>>> x.bytes
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'
# make a UUID from a 16-byte string
>>> uuid.UUID(bytes=x.bytes) #doctest: +SKIP
>>> uuid.UUID(bytes=x.bytes)
UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
"""