@@ -0,0 +1,1708 @@
+import pytest%0Afrom stack import Stack%0Afrom stack import Node%0A%0A%0A@pytest.fixture(scope='function')%0Adef simple_stack():%0A    stack = Stack()%0A    node1 = Node(1, None)%0A    node2 = Node(2, node1)%0A    stack.head = node2%0A    return stack%0A%0A%0A@pytest.fixture(scope='function')%0Adef codeeval_input1():%0A    stack = Stack()%0A    node1 = Node(1, None)%0A    node2 = Node(2, node1)%0A    node3 = Node(3, node2)%0A    node4 = Node(4, node3)%0A    stack.head = node4%0A    return stack%0A%0A%0A@pytest.fixture(scope='function')%0Adef codeeval_input2():%0A    stack = Stack()%0A    node1 = Node(10, None)%0A    node2 = Node(-2, node1)%0A    node3 = Node(3, node2)%0A    node4 = Node(4, node3)%0A    stack.head = node4%0A    return stack%0A%0A%0Adef test_make_new_stack():%0A    stack = Stack()%0A    assert stack.head is None%0A%0A%0Adef test_push_to_empty_stack():%0A    stack = Stack()%0A    stack.push(1)%0A    assert stack.head.value == 1%0A    assert stack.head.next_node is None%0A%0A%0Adef test_push_to_stack(simple_stack):%0A    stack = simple_stack%0A    stack.push(3)%0A    assert stack.head.value == 3%0A    assert stack.head.next_node.value == 2%0A    assert stack.head.next_node.next_node.value == 1%0A    assert stack.head.next_node.next_node.next_node is None%0A%0A%0Adef test_pop_from_empty_stack():%0A    with pytest.raises(LookupError):%0A        stack = Stack()%0A        stack.pop()%0A%0A%0Adef test_pop_from_stack(simple_stack):%0A    stack = simple_stack%0A    assert stack.pop() == 2%0A    assert stack.head.value == 1%0A    assert stack.head.next_node is None%0A%0A%0Adef test_write_codeeval_output_1(codeeval_input1):%0A    stack = codeeval_input1%0A    assert stack.write_output() == '4 2'%0A%0A%0Adef test_write_codeeval_output_2(codeeval_input2):%0A    stack = codeeval_input2%0A    assert stack.write_output() == '4 -2'%0A

Write tests for stack