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_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