-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2660b6
commit cfba115
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
|
||
import polytope.core.uuidgen as uuidgen | ||
|
||
|
||
def test_uuid(): | ||
assert len(uuidgen.uuid('abcde', 3)) == 3 | ||
|
||
gen = uuidgen.PolytopeUUID(alphabet='abcde', length=15) | ||
assert gen.alphabet == 'abcde' | ||
assert gen.length == 15 | ||
|
||
gen.length = 5 | ||
uuid = gen.uuid() | ||
assert len(uuid) == 5 | ||
for c in uuid: | ||
assert c in gen.alphabet | ||
|
||
gen = uuidgen.PolytopeUUID() | ||
assert len(gen.alphabet) == 32 | ||
assert gen.length == 8 |