Ejemplo n.º 1
0
 def setUp(self):
     head_node = LinkedList.create_node()
     self.list_without_head = LinkedList()
     self.list_with_head_node = LinkedList(head_node=head_node)
Ejemplo n.º 2
0
 def test_node_creation_with_data(self):
     test_node = LinkedList.create_node(data="hello")
     self.assertEqual(test_node.data, "hello")
Ejemplo n.º 3
0
 def test_node_creation_with_next_node(self):
     test_next_node = LinkedList.create_node()
     test_node = LinkedList.create_node(next_node=test_next_node)
     self.assertEqual(test_node.next_node, test_next_node)
Ejemplo n.º 4
0
 def test_node_creation_with_defaults(self):
     test_node = LinkedList.create_node()
     self.assertEqual(type(test_node), Node)