コード例 #1
0
ファイル: test_serialization.py プロジェクト: jab/greenamqp
    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')
コード例 #2
0
ファイル: test_serialization.py プロジェクト: jab/greenamqp
    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(), '')