def test_shortstr_unicode(self):
        w = AMQPWriter()
        w.write_shortstr(u'hello')
        s = w.getvalue()
        self.assertEqual(s, '\x05hello')

        r = AMQPReader(s)
        self.assertEqual(r.read_shortstr(), u'hello')
Ejemplo n.º 2
0
    def test_shortstr_unicode(self):
        w = AMQPWriter()
        w.write_shortstr(u'hello')
        s = w.getvalue()
        self.assertEqual(s, '\x05hello')

        r = AMQPReader(s)
        self.assertEqual(r.read_shortstr(), u'hello')
Ejemplo n.º 3
0
    def test_shortstr(self):
        w = AMQPWriter()
        w.write_shortstr('hello')
        s = w.getvalue()
        self.assertEqualBinary(s, '\x05hello')

        r = AMQPReader(s)
        self.assertEqual(r.read_shortstr(), 'hello')
Ejemplo n.º 4
0
    def test_shortstr(self):
        w = AMQPWriter()
        w.write_shortstr('hello')
        s = w.getvalue()
        self.assertEqualBinary(s, '\x05hello')

        r = AMQPReader(s)
        self.assertEqual(r.read_shortstr(), 'hello')
Ejemplo n.º 5
0
    def test_empty_shortstr(self):
        w = AMQPWriter()
        w.write_shortstr('')
        s = w.getvalue()

        self.assertEqual(s, '\x00')

        r = AMQPReader(s)
        self.assertEqual(r.read_shortstr(), '')
    def test_empty_shortstr(self):
        w = AMQPWriter()
        w.write_shortstr('')
        s = w.getvalue()

        self.assertEqual(s, '\x00')

        r = AMQPReader(s)
        self.assertEqual(r.read_shortstr(), '')
Ejemplo n.º 7
0
 def redirect(self, host, known_hosts):
     args = AMQPWriter()
     args.write_shortstr(host)
     args.write_shortstr(known_hosts)
     self._send_channel_method_frame(0, (10, 50), args)
Ejemplo n.º 8
0
 def redirect(self, host, known_hosts):
     args = AMQPWriter()
     args.write_shortstr(host)
     args.write_shortstr(known_hosts)
     self._send_channel_method_frame(0, (10, 50), args)