예제 #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