Skip to content

Commit dc94ae0

Browse files
committed
update the linked_list_test
1 parent e862c3b commit dc94ae0

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Sprint-2/implement_linked_list/linked_list_test.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ def test_remove_tail(self):
3434
self.assertIsNone(b.next)
3535
self.assertIsNone(b.previous)
3636

37+
def test_remove_middle(self):
38+
l = LinkedList()
39+
l.push_head("a")
40+
b = l.push_head("b")
41+
l.push_head("c")
42+
43+
l.remove(b)
44+
45+
self.assertIsNone(b.next)
46+
self.assertIsNone(b.previous)
47+
48+
self.assertEqual(l.pop_tail(), "a")
49+
self.assertEqual(l.pop_tail(), "c")
50+
3751

3852
if __name__ == "__main__":
3953
unittest.main()

0 commit comments

Comments
 (0)