def test_stop(self): s = self._socket() c = Connection(s) c.stop() # no packets should ever be returned after stoping # and it should return instantly eq_(list(c.packets()), [])
def test_packets(self): s, stream = self._with_data(self._dummy_msg) c = Connection(s) kind, body = six.next(c.packets()) eq_(kind, 116) eq_(body, "Hello World") eq_(stream.tell(), len(self._dummy_msg))
def test_no_packets(self): s = self._socket() s.closed = True c = Connection(s) six.next(c.packets())