#!/usr/bin/env python
# -*- coding: utf-8 -*-

import unittest

from lib.Stack import Stack


class TestStack(unittest.TestCase):

  def setUp(self):
    pass

  def test_empty(self):
    stack = Stack()
    self.assertEqual(True, stack.is_empty())

  def test_lifo(self):
    stack = Stack()
    stack.push(11)
    stack.push(22)
    stack.push(44)
    self.assertEqual(44, stack.top())

    stack.pop()
    self.assertEqual(22, stack.top())
    self.assertEqual(2, stack.size())
    self.assertEqual(False, stack.is_empty())

    stack.pop()
    self.assertEqual(11, stack.top())

    stack.pop()
    self.assertEqual(True, stack.is_empty())

  def test_clear(self):
    stack = Stack()
    stack.push(11)
    stack.push(22)
    stack.clear()
    self.assertEqual(True, stack.is_empty())

7b5f88983c373029742d604ed56330a0c3d66e8d
<mask token>


class TestStack(unittest.TestCase):

    def setUp(self):
        pass
    <mask token>

    def test_lifo(self):
        stack = Stack()
        stack.push(11)
        stack.push(22)
        stack.push(44)
        self.assertEqual(44, stack.top())
        stack.pop()
        self.assertEqual(22, stack.top())
        self.assertEqual(2, stack.size())
        self.assertEqual(False, stack.is_empty())
        stack.pop()
        self.assertEqual(11, stack.top())
        stack.pop()
        self.assertEqual(True, stack.is_empty())
    <mask token>

<mask token>


class TestStack(unittest.TestCase):

    def setUp(self):
        pass
    <mask token>

    def test_lifo(self):
        stack = Stack()
        stack.push(11)
        stack.push(22)
        stack.push(44)
        self.assertEqual(44, stack.top())
        stack.pop()
        self.assertEqual(22, stack.top())
        self.assertEqual(2, stack.size())
        self.assertEqual(False, stack.is_empty())
        stack.pop()
        self.assertEqual(11, stack.top())
        stack.pop()
        self.assertEqual(True, stack.is_empty())

    def test_clear(self):
        stack = Stack()
        stack.push(11)
        stack.push(22)
        stack.clear()
        self.assertEqual(True, stack.is_empty())

<mask token>


class TestStack(unittest.TestCase):

    def setUp(self):
        pass

    def test_empty(self):
        stack = Stack()
        self.assertEqual(True, stack.is_empty())

    def test_lifo(self):
        stack = Stack()
        stack.push(11)
        stack.push(22)
        stack.push(44)
        self.assertEqual(44, stack.top())
        stack.pop()
        self.assertEqual(22, stack.top())
        self.assertEqual(2, stack.size())
        self.assertEqual(False, stack.is_empty())
        stack.pop()
        self.assertEqual(11, stack.top())
        stack.pop()
        self.assertEqual(True, stack.is_empty())

    def test_clear(self):
        stack = Stack()
        stack.push(11)
        stack.push(22)
        stack.clear()
        self.assertEqual(True, stack.is_empty())

import unittest
from lib.Stack import Stack


class TestStack(unittest.TestCase):

    def setUp(self):
        pass

    def test_empty(self):
        stack = Stack()
        self.assertEqual(True, stack.is_empty())

    def test_lifo(self):
        stack = Stack()
        stack.push(11)
        stack.push(22)
        stack.push(44)
        self.assertEqual(44, stack.top())
        stack.pop()
        self.assertEqual(22, stack.top())
        self.assertEqual(2, stack.size())
        self.assertEqual(False, stack.is_empty())
        stack.pop()
        self.assertEqual(11, stack.top())
        stack.pop()
        self.assertEqual(True, stack.is_empty())

    def test_clear(self):
        stack = Stack()
        stack.push(11)
        stack.push(22)
        stack.clear()
        self.assertEqual(True, stack.is_empty())

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import unittest

from lib.Stack import Stack


class TestStack(unittest.TestCase):

  def setUp(self):
    pass

  def test_empty(self):
    stack = Stack()
    self.assertEqual(True, stack.is_empty())

  def test_lifo(self):
    stack = Stack()
    stack.push(11)
    stack.push(22)
    stack.push(44)
    self.assertEqual(44, stack.top())

    stack.pop()
    self.assertEqual(22, stack.top())
    self.assertEqual(2, stack.size())
    self.assertEqual(False, stack.is_empty())

    stack.pop()
    self.assertEqual(11, stack.top())

    stack.pop()
    self.assertEqual(True, stack.is_empty())

  def test_clear(self):
    stack = Stack()
    stack.push(11)
    stack.push(22)
    stack.clear()
    self.assertEqual(True, stack.is_empty())
