def test_resume_on_init(self):
        protocol = mock.Mock()
        protocol._reading_paused = True

        streams.FlowControlDataQueue(protocol, limit=1, loop=self.loop)
        self.assertTrue(protocol.transport.resume_reading.called)
        self.assertFalse(protocol._reading_paused)
    def test_no_transport_in_init(self):
        protocol = mock.Mock()
        protocol._reading_paused = True
        protocol.transport = None

        streams.FlowControlDataQueue(protocol, limit=1, loop=self.loop)
        self.assertTrue(protocol._reading_paused)
Beispiel #3
0
    def test_no_transport_in_init(self):
        stream = unittest.mock.Mock()
        stream.paused = True
        stream.transport = None

        streams.FlowControlDataQueue(stream, limit=1, loop=self.loop)
        self.assertTrue(stream.paused)
Beispiel #4
0
    def test_resume_on_init(self):
        stream = unittest.mock.Mock()
        stream.paused = True

        streams.FlowControlDataQueue(stream, limit=1, loop=self.loop)
        self.assertTrue(stream.transport.resume_reading.called)
        self.assertFalse(stream.paused)
 def _make_one(self, *args, **kwargs):
     out = streams.FlowControlDataQueue(self.protocol,
                                        limit=1,
                                        loop=self.loop,
                                        *args,
                                        **kwargs)
     out._allow_pause = True
     return out
Beispiel #6
0
 def function2883(self, *args, **kwargs):
     var4517 = streams.FlowControlDataQueue(self.attribute1808,
                                            *args,
                                            limit=1,
                                            loop=self.attribute1376,
                                            None=kwargs)
     var4517._allow_pause = True
     return var4517
Beispiel #7
0
 def setUp(self):
     self.stream = unittest.mock.Mock()
     self.loop = asyncio.new_event_loop()
     asyncio.set_event_loop(None)
     self.buffer = streams.FlowControlDataQueue(self.stream, loop=self.loop)
def buffer(loop, protocol):
    out = streams.FlowControlDataQueue(protocol, limit=1, loop=loop)
    out._allow_pause = True
    return out
Beispiel #9
0
 def _make_one(self, *args, **kwargs):
     return streams.FlowControlDataQueue(self.stream,
                                         limit=1,
                                         loop=self.loop,
                                         *args,
                                         **kwargs)