def test_pop_not_empty(self): stack = Stack() stack.stack = [1, 2, 3] self.assertEqual(1, stack.pop()) self.assertEqual(2, len(stack.stack))
def test_peek_is_not_empty(self): stack = Stack() stack.stack = ['bananas'] self.assertEqual('bananas', stack.peek())
def test_is_empty_is_false(self): stack = Stack() stack.stack = [1, 2, 3] self.assertFalse(stack.is_empty())