def test_top_stack_empty(): with pytest.raises(Exception): stack = Stack() expected = Exception("The stack is empty.") actual = stack.top() assert actual == expected, 'Error on test_top_stack_empty.'
def test_is_empty_true(): stack = Stack() expected = True actual = stack.is_empty() assert actual == expected, 'Error on test_is_empty_true.'
def test_top_stack_not_empty(): stack = Stack() value = 50 stack.push(value) expected = value actual = stack.top() assert actual == expected, 'Error on test_top_stack_not_empty.'
def test_push_stack(): stack = Stack() value = 50 stack.push(value) expected = value actual = stack.min_top() assert actual == expected, 'Error on test_push_stack.'
def test_is_empty_false(): stack = Stack() value = 50 stack.push(value) expected = False actual = stack.is_empty() assert actual == expected, 'Error on test_is_empty_false.'
def test_min_stack(): stack = Stack() stack.push(50) stack.push(100) stack.push(10) stack.push(30) expected = 10 actual = stack.min() assert actual == expected, 'Error on test_min_stack.'
def test_top_stack(): stack = Stack() value = 50 stack.push(value) value = 100 stack.push(value) value = 200 stack.push(value) expected = value actual = stack.top() assert actual == expected, 'Error on test_top_stack.'
def test_min_stack_large(): stack = Stack() stack.push(50) stack.push(100) stack.push(1000) stack.push(30) stack.push(150) stack.push(250) stack.push(5) stack.push(500) stack.pop() stack.pop() stack.pop() stack.pop() stack.pop() expected = 50 actual = stack.min() assert actual == expected, 'Error on test_min_stack_large.'