Example #1
0
def test_size_one():
    """
    Test that password is of size 1.
    """
    assert validate_if("a") == True
Example #2
0
def test_dot_minus():
    """
    Test that password can contain "." "-".
    """
    assert validate_if("éáíúóp.ds-ipas") == True
Example #3
0
def test_special_chars():
    """
    Test that password cannot contain other special characters.
    """
    assert validate_if("éáíúópao!!dsipas") == False
Example #4
0
def test_number_end():
    """
    Test that password ends with number.
    """
    assert validate_if("éáíúópaodsipas2") == True
Example #5
0
def test_character_end():
    """
    Test that password doesn't end with special characters.
    """
    assert validate_if("éáíúópaodsipas!") == False
Example #6
0
def test_latin_end():
    """
    Test that password ends with latin characters.
    """
    assert validate_if("éáíúópaodsipas") == True
Example #7
0
def test_character_start():
    """
    Test that password doesn't starts with special characters.
    """
    assert validate_if("!éáíúópaodsipas") == False
Example #8
0
def test_number_start():
    """
    Test that password doesn't starts with number.
    """
    assert validate_if("2éáíúópaodsipas") == False
Example #9
0
def test_size_twenty():
    """
    Test that password is of size 20.
    """
    assert validate_if("a" * 20) == True
Example #10
0
def test_size_twentyone():
    """
    Test that password cannot be of size more than 20
    """
    assert validate_if("a" * 21) == False