Exemplo n.º 1
0
def test_first():
    colors = SingleLinkedList()
    colors.push("Cadmium Red Light")
    assert colors.first() == "Cadmium Red Light"
    colors.push("Hansa Yellow")
    assert colors.first() == "Cadmium Red Light"
    colors.shift("Pthalo Green")
    assert colors.first() == "Pthalo Green"
Exemplo n.º 2
0
 def test_first(self):
     colors = SingleLinkedList()
     colors.push('Cadmium Red Light')
     assert colors.first() == 'Cadmium Red Light'
     colors.push('Hansa Yellow')
     assert colors.first() == 'Cadmium Red Light'
     colors.shift('Pthalo Green')
     assert colors.first() == 'Pthalo Green'
Exemplo n.º 3
0
def test_first():
    colors = SingleLinkedList()
    colors.push('red')
    assert colors.first() == 'red'

    colors.push('yellow')
    assert colors.first() == 'red'

    colors.push('blue')
    assert colors.first() == 'red'