diff --git a/test/core/uuidgen_test.py b/test/core/uuidgen_test.py new file mode 100644 index 0000000..fc809db --- /dev/null +++ b/test/core/uuidgen_test.py @@ -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