def test_pop_back_when_single_item_linkedlist(self): # Arrange linkedlist = LinkedList() linkedlist.push_back("Umair") # Act linkedlist.pop_back() # Assert self.assertTrue(linkedlist.size() == 0) self.assertRaises(ValueError, linkedlist.find, "Umair")
def test_pop_back_when_more_than_one_items_linkedlist(self): # Arrange linkedlist = LinkedList() linkedlist.push_back("Umair") linkedlist.push_back("Aamir") # Act linkedlist.pop_back() # Assert self.assertTrue(linkedlist.size() == 1) self.assertRaises(ValueError, linkedlist.find, "Aamir")