Beispiel #1
0
 def test_clear(self):
     """testcase8:Clear method test"""
     Stack_default = Stack(data_type=int, limit=11)
     Stack_default.push(1)
     Stack_default.push(2)
     Stack_default.push(3)
     Stack_default.clear()
     self.assertEqual(Stack_default.count(), 0)
Beispiel #2
0
 def test_pull(self):
     """testcase4: Add two elements into stack and delete one , expected result
        deleteted element is correct and amount is equal 2
     """
     Stack_default = Stack(data_type=int, limit=11)
     Stack_default.push(1)
     Stack_default.push(2)
     Stack_default.push(3)
     self.assertEqual(Stack_default.pull(), 3)
     self.assertEqual(Stack_default.count(), 2)
Beispiel #3
0
 def test_init_add(self):
     """testcase3: Add two elements into stack and validate amount"""
     Stack_default = Stack(data_type=int, limit=11)
     Stack_default.push(1)
     Stack_default.push(2)
     self.assertEqual(Stack_default.count(), 2)