Ejemplo n.º 1
0
def test_when_expression_maximum_are_thirty_chars():
    long_expression = (
        "1111111111"  # 10 chars
        "1111111111"
        "1111111111"
        "1"
    )
    with pytest.raises(ValueError):
        translate_to_number(long_expression)
Ejemplo n.º 2
0
def test_expression_with_invalid_chars():
    with pytest.raises(ValueError):
        translate_to_number("I-****-MY_JOB")
Ejemplo n.º 3
0
def test_when_expression_should_be_at_least_one_char():
    with pytest.raises(ValueError):
        translate_to_number("")
Ejemplo n.º 4
0
def test_when_wxyz_should_be_converted_in_9():
    assert translate_to_number("WXYZ") == "9999"
Ejemplo n.º 5
0
def test_when_dashe_zero_one_should_be_keeped():
    assert translate_to_number("0-1") == "0-1"
Ejemplo n.º 6
0
def test_when_pqrs_should_be_converted_in_7():
    assert translate_to_number("PQRS") == "7777"
Ejemplo n.º 7
0
def test_when_tuv_should_be_converted_in_8():
    assert translate_to_number("TUV") == "888"
Ejemplo n.º 8
0
def test_when_mno_should_be_converted_in_6():
    assert translate_to_number("MNO") == "666"
Ejemplo n.º 9
0
def test_when_jkl_should_be_converted_in_5():
    assert translate_to_number("JKL") == "555"
Ejemplo n.º 10
0
def test_when_ghi_should_be_converted_in_4():
    assert translate_to_number("GHI") == "444"
Ejemplo n.º 11
0
def test_when_def_should_be_converted_in_3():
    assert translate_to_number("DEF") == "333"
Ejemplo n.º 12
0
def test_when_abc_should_be_converted_in_2():
    assert translate_to_number("ABC") == "222"