Esempio n. 1
0
def test_convert_name(name):
    """
    Test that convert_name returns 'ERROR' if length of name less than 3 letters.

    Example: name = "ab" gives "ERROR".
    """
    assert calculator.convert_name(name) == "ERROR"
Esempio n. 2
0
def test_convert_name_capital_ending():
    """
    Test that convert_name() converts string as supposed to even when string ends with capital letters.
    [first three letters in uppercase]-[length of string][last two letters of string in lowercase]

    Example: "abc"  # -> "ABC-3bc"
    """
    assert calculator.convert_name("BurrougTS") == "BUR-9ts"
Esempio n. 3
0
def test_convert_name_short_string():
    """
    Test that convert_name() converts string as supposed to even when string extremely short.
    [first three letters in uppercase]-[length of string][last two letters of string in lowercase]

    Example: "abc"  # -> "ABC-3bc"
    """
    assert calculator.convert_name("7v6") == "7V6-3v6"
Esempio n. 4
0
def test_convert_name2():
    """
    Test that convert_name() converts string as supposed to, even with numbers in it.
    [first three letters in uppercase]-[length of string][last two letters of string in lowercase]

    Example: "abc"  # -> "ABC-3bc"
    """
    assert calculator.convert_name("uT999AIUHjbhh76235g3dhj") == "UT9-23hj"
Esempio n. 5
0
def test_convert_name1():
    """
    Test that convert_name() converts string as supposed to.
    [first three letters in uppercase]-[length of string][last two letters of string in lowercase]

    Example: "abc"  # -> "ABC-3bc"
    """
    assert calculator.convert_name("Burroughs") == "BUR-9hs"
Esempio n. 6
0
def test_convert_name_long_string():
    """
    Test that convert_name() converts string as supposed to even when string extremely long.
    [first three letters in uppercase]-[length of string][last two letters of string in lowercase]

    Example: "abc"  # -> "ABC-3bc"
    """
    assert calculator.convert_name(
        "90uT999AIUHjbhh76235g3dhhggfTTFSVGHBJBHSBHJ9897879885444j"
    ) == "90U-574j"