Exemplo n.º 1
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())
Exemplo n.º 2
0
def test_set_data():
    """Test node module set data method."""
    from linked_list import Node
    test_node = Node(data[0])
    test_node.set_data(data[1])
    assert test_node.data == data[1]