def test_circle_linked(self): cll = CircleLinkedList() cll.add(12) cll.add(24) cll.add(48) cll.add(96) link_first = cll.get_link(12) self.assertEqual(None, link_first.prev) self.assertEqual(24, link_first.next) self.assertEqual(None, link_first.start) self.assertEqual(96, link_first.end) link_middle = cll.get_link(24) self.assertEqual(12, link_middle.prev) self.assertEqual(48, link_middle.next) self.assertEqual(None, link_middle.start) self.assertEqual(None, link_middle.end) link_last = cll.get_link(48) self.assertEqual(24, link_last.prev) self.assertEqual(96, link_last.next) self.assertEqual(None, link_last.start) self.assertEqual(None, link_last.end) link_last = cll.get_link(96) self.assertEqual(48, link_last.prev) self.assertEqual(None, link_last.next) self.assertEqual(12, link_last.start) self.assertEqual(None, link_last.end) self.assertEqual(False, cll.empty())
def test_not_empty(self): cll = CircleLinkedList() cll.add(12) self.assertEqual(False, cll.empty())
def test_empty(self): cll = CircleLinkedList() self.assertEqual(True, cll.empty())