Пример #1
0
 def test_pop(self):
     buf = CharBuffer('a')
     self.assertEqual('a', buf.pop())
     self.assertRaises(EmptyBufferException, lambda: buf.pop())
Пример #2
0
 def test_eof(self):
     self.assertTrue(CharBuffer('').eof())
     buf = CharBuffer('x')
     self.assertFalse(buf.eof())
     buf.pop()
     self.assertTrue(buf.eof())
Пример #3
0
 def test_peek(self):
     buf = CharBuffer('a')
     self.assertEqual('a', buf.peek())
     buf.pop()
     self.assertIsNone(buf.peek())