def my_stack():
    new_stack = Stack()
    values = ["a", "b", "c", 10]
    for el in values:
        new_stack.push(el)

    return new_stack
def test_peek():
    s = Stack()
    s.push("apple")
    s.push("banana")
    actual = s.peek()
    expected = "banana"
    assert actual == expected
Exemple #3
0
def init_stack():
    new_stack = Stack()
    my_list = [1, 2, 3, 4]
    for el in my_list:
        new_stack.push(el)

    return new_stack
Exemple #4
0
def my_stack():
    new_stack = Stack()
    values = ['a', 'b', 'c', 10]
    for el in values:
        new_stack.push(el)

    return new_stack
Exemple #5
0
def test_PseudoQueue_init_stack():
	stack_one = Stack()
	stack_one.push(15)
	stack_one.push(10)
	stack_one.push(5)
	stack_one.push(0)
	queue = PseudoQueue(stack_one)
	actual = str(queue)
	expected = '0 ->5 ->10 ->15'
	assert actual == expected
def test_pop_some():
    s = Stack()
    s.push("apple")
    s.push("banana")
    s.push("cucumber")
    s.pop()
    actual = s.pop()
    expected = "banana"
    assert actual == expected
def test_pop_single():
    s = Stack()
    s.push("apple")
    actual = s.pop()
    expected = "apple"
    assert actual == expected
Exemple #8
0
def new_stack():
    print('in new list')
    test_stack = Stack()
    for i in range(1, 20):
        test_stack.push(i)
    return test_stack