mirror of https://github.com/mahmoud/boltons.git
Add is_uuid unit-tests, including garbage types.
This commit is contained in:
parent
e5f82de36b
commit
0b797d14a6
|
@ -1,5 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import uuid
|
||||||
|
|
||||||
from boltons import strutils
|
from boltons import strutils
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,3 +16,11 @@ def test_indent():
|
||||||
to_indent = '\nabc\ndef\n\nxyz\n'
|
to_indent = '\nabc\ndef\n\nxyz\n'
|
||||||
ref = '\n abc\n def\n\n xyz\n'
|
ref = '\n abc\n def\n\n xyz\n'
|
||||||
assert strutils.indent(to_indent, ' ') == ref
|
assert strutils.indent(to_indent, ' ') == ref
|
||||||
|
|
||||||
|
|
||||||
|
def test_is_uuid():
|
||||||
|
assert strutils.is_uuid(uuid.uuid4()) == True
|
||||||
|
assert strutils.is_uuid(uuid.uuid4(), version=1) == False
|
||||||
|
assert strutils.is_uuid(str(uuid.uuid4())) == True
|
||||||
|
assert strutils.is_uuid(str(uuid.uuid4()), version=1) == False
|
||||||
|
assert strutils.is_uuid(set('garbage')) == False
|
||||||
|
|
Loading…
Reference in New Issue