コード例 #1
0
ファイル: test_utils.py プロジェクト: FalloutX/cmd-todo
def test_gce_instance():
    """
    The output of generate_unique_code should be an instance of 'str'.
    """
    assert isinstance(utils.generate_unique_code(5), str)
コード例 #2
0
ファイル: test_utils.py プロジェクト: FalloutX/cmd-todo
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
コード例 #3
0
ファイル: test_utils.py プロジェクト: FalloutX/cmd-todo
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
コード例 #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
コード例 #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)
コード例 #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
コード例 #7
0
ファイル: filebase.py プロジェクト: ijxsid/cmd-todo
 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