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
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)