"""Some simple tests for the Stack class."""

import nose
from stack import Stack

def test_empty_stack():
    """Make sure an empty stack behaves as expected."""
    s = Stack()
    assert s.empty(), "Stack is not empty."
    assert s.size() == 0, "There is at least one item on the stack."
    
def test_one_item():
    """Push and pop one item on to / from the stack."""
    s = Stack()
    s.push("blerg")
    assert s.size() == 1, "There should only be 1 item on the stack."
    assert not s.empty()
        
    pop = s.pop()
    assert pop == "blerg", "Item removed from the stack was not \"blerg\"."
    assert s.empty(), "After only item removed, stack still not empty."

if __name__ == "__main__":
    nose.runmodule()

