def test_get_data(self):
     ''' Tests Node method: get_data(self). '''
     provided_data = {
         'first_name': ' Keith',
         'last_name': 'LICHTEN',
         'rank': 'A14',
         'team': 'EBFG '
     }
     new_node = Node(provided_data)
     self.assertDictEqual(new_node.get_data(), new_node.data,
                          'Should return the nodes data.')
 def test_get_data(self):
     node = Node(1)
     assert node.get_data() == 1
Example #3
0
from linked_list import Node

node = Node(9)
print(node)
print(node.get_data())
node.set_data(10)
print(node.get_data())

print("------------")

print(node.get_next())
other_node = Node(0)

node.set_next(other_node)
print(node.get_next())
print(node.get_next().get_data())
def test_get_data():
    """Test node module get data method."""
    from linked_list import Node
    test_node = Node(data[0])
    assert test_node.get_data() == data[0]
Example #5
0
def test_get_data():
    """Test get_data method."""
    from linked_list import Node
    new_node = Node("word")
    assert new_node.get_data() == "word"