Exemple #1
0
def test_gce_instance():
    """
    The output of generate_unique_code should be an instance of 'str'.
    """
    assert isinstance(utils.generate_unique_code(5), str)
Exemple #2
0
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
Exemple #3
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
Exemple #4
0
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
Exemple #5
0
def test_gce_instance():
    """
    The output of generate_unique_code should be an instance of 'str'.
    """
    assert isinstance(utils.generate_unique_code(5), str)
Exemple #6
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
Exemple #7
0
 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