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"
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'
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'