예제 #1
0
def test_last():
    colors = SingleLinkedList()
    colors.push("Cadmium Red Light")
    assert colors.last() == "Cadmium Red Light"
    colors.push("Hansa Yellow")
    assert colors.last() == "Hansa Yellow"
    colors.shift("Pthalo Green")
    assert colors.last() == "Hansa Yellow"
예제 #2
0
 def test_last(self):
     colors = SingleLinkedList()
     colors.push('Cadmium Red Light')
     assert colors.last() == 'Cadmium Red Light'
     colors.push('Hansa Yellow')
     assert colors.last() == 'Hansa Yellow'
     colors.shift('Pthalo Green')
     assert colors.last() == 'Hansa Yellow'
예제 #3
0
def test_last():
    colors = SingleLinkedList()
    colors.push('red')
    assert colors.last() == 'red'

    colors.push('yellow')
    assert colors.last() == 'yellow'

    colors.push('blue')
    assert colors.last() == 'blue'