Exemplo n.º 1
0
def test_swap_one_item_in_stack():
    state = State(stack=[1])
    with pytest.raises(exc.StackError):
        state.swap()
Exemplo n.º 2
0
def test_dup():
    state = State(stack=[1, 1])
    state.swap()
    assert state.stack == [1, 1]
Exemplo n.º 3
0
def test_swap_empty_stack():
    state = State()
    with pytest.raises(exc.StackError):
        state.swap()
Exemplo n.º 4
0
def test_swap():
    state = State(stack=[1, 2])
    state.swap()
    assert state.stack == [2, 1]