MCPcopy
hub / github.com/tornadoweb/tornado / test_order

Method test_order

tornado/test/queues_test.py:389–400  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

387
388 @gen_test
389 def test_order(self):
390 q = self.queue_class(maxsize=2)
391 q.put_nowait(1)
392 q.put_nowait(0)
393 self.assertTrue(q.full())
394 q.put(3)
395 q.put(2)
396 self.assertEqual(3, q.get_nowait())
397 self.assertEqual(2, (yield q.get()))
398 self.assertEqual(0, q.get_nowait())
399 self.assertEqual(1, (yield q.get()))
400 self.assertTrue(q.empty())
401
402
403class ProducerConsumerTest(AsyncTestCase):

Callers

nothing calls this directly

Calls 6

put_nowaitMethod · 0.80
fullMethod · 0.80
get_nowaitMethod · 0.80
emptyMethod · 0.80
putMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected