

@gen_test
def test_maxsize(self):
    self.assertRaises(TypeError, queues.Queue, maxsize=None)
    self.assertRaises(ValueError, queues.Queue, maxsize=(- 1))
    q = queues.Queue(maxsize=2)
    self.assertTrue(q.empty())
    self.assertFalse(q.full())
    self.assertEqual(2, q.maxsize)
    self.assertTrue(q.put(0).done())
    self.assertTrue(q.put(1).done())
    self.assertFalse(q.empty())
    self.assertTrue(q.full())
    put2 = q.put(2)
    self.assertFalse(put2.done())
    self.assertEqual(0, (yield q.get()))
    self.assertTrue(put2.done())
    self.assertFalse(q.empty())
    self.assertTrue(q.full())

dataset/ETHPy150Open tornadoweb/tornado/tornado/test/queues_test.py QueueBasicTest.test_maxsize/original