コード例 #1
0
def test_humanize_type():
    assert type(humanize("0")) is str
コード例 #2
0
def test_humanize_number():
    assert humanize("122") == "one hundred twenty two"
コード例 #3
0
def test_humanize_long():
    assert humanize(
        "1 + 2 - 3 + 4 - 5 = 6 * 7 / 8"
    ) == "one plus two minus three plus four minus five equals six multiply by seven divide by eight"
コード例 #4
0
def test_humanize_spaces():
    assert humanize("      1 * 1 =    20 -    1 9       "
                    ) == "one multiply by one equals twenty minus nineteen"
コード例 #5
0
def test_humanize_wrong_symbols():
    assert humanize(" ^ . ") == "invalid input"
コード例 #6
0
def test_humanize_symbols():
    assert humanize("1+=") == "invalid input"
コード例 #7
0
def test_humanize_common():
    assert humanize("1 + 1 = 2") == "one plus one equals two"