def test_exists_method(self):
        linked_list = LinkedList()
        find_me = {'foo4': 'bar', 'bar': 123}

        self.assertFalse(linked_list.exists(find_me))

        linked_list.insert(find_me)
        self.assertTrue(linked_list.exists(find_me))
    def test_deleting_an_item(self):
        linked_list = LinkedList()
        jane = Student("Doe", "Jane", "123-123-1234", "*****@*****.**", 23)
        john = Student("Doe", "John", "223-123-1234", "*****@*****.**", 23)
        jake = Student("Doe", "Jake", "323-123-1234", "*****@*****.**", 23)

        dummy_john = StudentFactory.create_dummy_from_ssn("223-123-1234")

        self.assertFalse(linked_list.delete(dummy_john))

        self.assertTrue(linked_list.insert(jane))
        self.assertTrue(linked_list.insert(john))
        self.assertTrue(linked_list.insert(jake))

        # return

        self.assertEqual(3, linked_list.size())
        self.assertTrue(linked_list.delete(dummy_john))
        self.assertFalse(linked_list.exists(dummy_john))
        self.assertEqual(2, linked_list.size())
 def test_finding_an_existing_element(self):
     linked_list = LinkedList()
     the_item = {'foo': 'bar'}
     self.assertFalse(linked_list.exists(the_item))
     linked_list.insert(the_item)
     self.assertTrue(linked_list.exists(the_item))