def test_gce_instance(): """ The output of generate_unique_code should be an instance of 'str'. """ assert isinstance(utils.generate_unique_code(5), str)
def test_gce_no_number(numerical_regex): """ The output of generate_unique_code should not conatain any numbers. """ code = utils.generate_unique_code() assert len(numerical_regex.findall(code)) == 0
def test_gce_length(): """ the length of output of generate_unique_code should be equal to its argument. """ assert len(utils.generate_unique_code(6)) == 6
def get_unique_counter_code(self): code = generate_unique_code(4) while code in self._data["counter"].keys(): code = generate_unique_code(4) return code