Ejemplo n.º 1
0
 def test_stack(self):
     x = _FastLocalStack()
     x.push(['foo'])
     x.push(['bar'])
     assert x.top == ['bar']
     assert len(x) == 2
     x.pop()
     assert x.top == ['foo']
     x.pop()
     assert x.top is None
Ejemplo n.º 2
0
 def test_stack(self):
     x = _FastLocalStack()
     x.push(['foo'])
     x.push(['bar'])
     self.assertEqual(x.top, ['bar'])
     self.assertEqual(len(x), 2)
     x.pop()
     self.assertEqual(x.top, ['foo'])
     x.pop()
     self.assertIsNone(x.top)
Ejemplo n.º 3
0
 def test_stack(self):
     x = _FastLocalStack()
     x.push(['foo'])
     x.push(['bar'])
     self.assertEqual(x.top, ['bar'])
     self.assertEqual(len(x), 2)
     x.pop()
     self.assertEqual(x.top, ['foo'])
     x.pop()
     self.assertIsNone(x.top)
Ejemplo n.º 4
0
 def test_stack(self):
     x = _FastLocalStack()
     x.push(['foo'])
     x.push(['bar'])
     assert x.top == ['bar']
     assert len(x) == 2
     x.pop()
     assert x.top == ['foo']
     x.pop()
     assert x.top is None