Пример #1
0
def test_one_number():
    assert add("1") == 1
Пример #2
0
def test_custom_delimiter():
    assert add("//X\n1X2") == 3
Пример #3
0
def test_empty():
    assert add("") == 0
Пример #4
0
def test_negative_numbers():
    with pytest.raises(Exception):
        add("-1,10")
Пример #5
0
def test_big_numbers():
    assert add("1001,1000") == 1000
Пример #6
0
def test_newline_delim():
    assert add("1\n2,3") == 6
Пример #7
0
def test_unknown_amount_of_numbers():
    assert add("1,2,3,4,5") == 15
Пример #8
0
def test_two_numbers():
    assert add("1,2") == 3