Exemplo n.º 1
0
 def test_for_empty_stack(self):
     stack = []
     item = "1"
     sy.pushToStack(stack, item)
     self.assertIsNotNone(stack)
     self.assertFalse(sy.stackIsEmpty(stack))
 def test_pass_wrong_arg(self):
     testStack = []
     with self.assertRaises(TypeError):
         sy.stackIsEmpty()
     with self.assertRaises(TypeError):
         sy.stackIsEmpty('')
Exemplo n.º 3
0
 def test_empty_stack(self):
     stack = []
     self.assertTrue(sy.stackIsEmpty(stack))
 def test_non_empty_stack(self):
     testStack = ['definently not empty']
     self.assertFalse(sy.stackIsEmpty(testStack))