def test_is_empty_add_at_head(self): dl = DoublyLinkedList() eq_(dl.is_empty(), True) dl.add_at_head(30) dl.add_at_head(20) dl.add_at_head(10) eq_(dl.is_empty(), False) eq_(dl.head.data, 10) eq_(dl.head.next.prev.data, 10) eq_(dl.head.next.data, 20) eq_(dl.head.next.next.prev.data, 20) eq_(dl.head.next.next.data, 30)