import pathlib import sys current = pathlib.Path(__file__) test_dir = current.parent project_dir = test_dir.parent source_dir = project_dir / pathlib.Path("source") sys.path.append(str(source_dir)) import cx_apikey as apikey test_count = 0 def test(tag: str, result: bool) -> None: global test_count test_count += 1 print("Running test " + tag + " (" + str(test_count) + "):", end = " ") if result: print("Valid") return print("FAIL!!!") exit(-1) factory = apikey.apikey_factory("test").set_size(10) sample = factory.generate() sample_manual = "test_1234567890" bad_sample = "no_1234567890" other_bad = "test_uuuuuuuuuu" factory.get_validator()