You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
599 B

import uuid
class Manager():
# Manager class to manage a notiframe session.
def __init__(self):
self.devices = {}
def gen_id(self):
return uuid.uuid4()
#do function wrapper here for tests functions, to say "test_function_name" success/failure
def TEST_manager():
manager = Manager()
uuid_test = manager.gen_id()
print(is_valid_uuid(uuid_test))
# Test if manager class's gen_id function produces a valid uuid
def is_valid_uuid(val):
try:
uuid.UUID(str(val))
return True
except ValueError:
return False
TEST_manager()