def test_zip(): lista = LinkedList() listb = LinkedList() lista.append_item('A') lista.append_item('B') listb.append_item('1') listb.append_item('2') answer = lista.zip_list(listb) actual = answer.find_all() expected = ['A', '1', 'B', '2'] assert actual == expected
def test_x_fromend0(): list = LinkedList() list.append_item('rock') list.append_item('paper') list.append_item('scissors') list.append_item('machinegun') actual = list.x_fromend(0) expected = 'machinegun' assert actual == expected
def test_add_after_value1(): list = LinkedList() list.append_item('rock') list.append_item('paper') list.append_item('scissors') list.append_item('machinegun') list.inject_a('scissors', 'cannon') actual = list.find_all() expected = ['rock', 'paper', 'scissors', 'cannon', 'machinegun'] assert actual == expected
def test_append_end(): list = LinkedList() list.append_item('rock') list.append_item('paper') list.append_item('scissors') actual = list.head.data expected = "rock" assert actual == expected
def test_x_fromend_neg(): list = LinkedList() list.append_item('machinegun') actual = list.x_fromend(-2) expected = 'Exception' assert actual == expected
def test_x_fromend_one_item(): list = LinkedList() list.append_item('machinegun') actual = list.x_fromend(0) expected = 'machinegun' assert actual == expected