Esempio n. 1
0
def test_odd_length():
    assert split_list([1, 2, 3]) == [[1, 2], [3]], "Odd length"
Esempio n. 2
0
def test_incorrect_argument():
    with pytest.raises(TypeError):
        split_list(123456)
Esempio n. 3
0
def test_even_length():
    assert split_list([1, 2, 3, 4]) == [[1, 2], [3, 4]], "Even length"
Esempio n. 4
0
def test_no_argument():
    with pytest.raises(TypeError):
        split_list()
Esempio n. 5
0
def test_string():
    assert split_list("hello") == [["h", "e", "l"], ["l", "o"]], "A string"
Esempio n. 6
0
def test_one_element():
    assert split_list([1]) == [[1], []], "One element"
Esempio n. 7
0
def test_empty_list():
    assert split_list([]) == [[], []], "Empty list"
Esempio n. 8
0
def test_long_odd_length():
    assert split_list([1, 2, 3, 4, 5, 6, 7, 8, 9]) == [[1, 2, 3, 4, 5],
                                                       [6, 7, 8,
                                                        9]], "Long odd length"