def test_push(): colors = DoubleLinkedList() colors.push("Pthalo Blue") colors._invariant() assert colors.count() == 1 colors.push("Ultramarine Blue") assert colors.count() == 2 colors._invariant()
def test_shift(): colors = DoubleLinkedList() colors.shift("Cadmium Orange") assert colors.count() == 1 colors.shift("Carbazole Violet") assert colors.count() == 2 assert colors.pop() == "Cadmium Orange" assert colors.count() == 1 assert colors.pop() == "Carbazole Violet" assert colors.count() == 0