示例#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