Exemple #1
0
def test_odd_length():
    assert split_list([1, 2, 3]) == [[1, 2], [3]], "Odd length"
Exemple #2
0
def test_incorrect_argument():
    with pytest.raises(TypeError):
        split_list(123456)
Exemple #3
0
def test_even_length():
    assert split_list([1, 2, 3, 4]) == [[1, 2], [3, 4]], "Even length"
Exemple #4
0
def test_no_argument():
    with pytest.raises(TypeError):
        split_list()
Exemple #5
0
def test_string():
    assert split_list("hello") == [["h", "e", "l"], ["l", "o"]], "A string"
Exemple #6
0
def test_one_element():
    assert split_list([1]) == [[1], []], "One element"
Exemple #7
0
def test_empty_list():
    assert split_list([]) == [[], []], "Empty list"
Exemple #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"