Exemplo n.º 1
0
 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()), [])
Exemplo n.º 2
0
 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()), [])
Exemplo n.º 3
0
    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))
Exemplo n.º 4
0
    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))
Exemplo n.º 5
0
    def test_no_packets(self):
        s = self._socket()
        s.closed = True
        c = Connection(s)

        six.next(c.packets())
Exemplo n.º 6
0
    def test_no_packets(self):
        s = self._socket()
        s.closed = True
        c = Connection(s)

        six.next(c.packets())