Exemplo n.º 1
0
 def test_is_present_false(self):
     '''
     When trying to find out if a value is present in the list.
     1. The value must be previously inserted.
     2. When method is called, False is expected.
     '''
     ll = LinkedList()
     some_value = "gutentag"
     ll.append("alo")
     ll.append("aloha")
     ll.append("Konnichiwa")
     self.assertFalse(ll.is_present(some_value))
Exemplo n.º 2
0
 def test_delete_at_index(self):
     '''
     When trying to delete a node at a given position.
     1. Delete a node at a desired index.
     2. index must not be present in the list.
     '''
     ll = LinkedList()
     some_value = "Delete me"
     ll.append("s")
     ll.append("d")
     ll.append(some_value)
     ll.append("45")
     self.assertEqual(ll.delete_at(2), some_value)
     self.assertFalse(ll.is_present(some_value))