Ejemplo n.º 1
0
    def test_encode_header(self):
        stream = sol.encode('hello', {})

        self.assertEqual(
            stream.getvalue(),
            '\x00\xbf\x00\x00\x00\x15TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello'
            '\x00\x00\x00\x00')
Ejemplo n.º 2
0
    def test_encode_header(self):
        stream = sol.encode('hello', {})

        self.assertEqual(
            stream.getvalue(),
            '\x00\xbf\x00\x00\x00\x15TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello'
            '\x00\x00\x00\x00'
        )
Ejemplo n.º 3
0
    def test_amf3(self):
        bytes = '\x00\xbf\x00\x00\x00aTCSO\x00\x04\x00\x00\x00\x00\x00\x08' + \
            'EchoTest\x00\x00\x00\x03\x0fhttpUri\x06=http://localhost:8000' + \
            '/gateway/\x00\x0frtmpUri\x06+rtmp://localhost/echo\x00'

        stream = sol.encode(u'EchoTest',
            {u'httpUri': u'http://localhost:8000/gateway/', u'rtmpUri': u'rtmp://localhost/echo'}, encoding=pyamf.AMF3)

        self.assertEquals(stream.getvalue(), bytes)
Ejemplo n.º 4
0
    def test_amf3(self):
        bytes = ('\x00\xbf\x00\x00\x00aTCSO\x00\x04\x00\x00\x00\x00\x00\x08' + \
            'EchoTest\x00\x00\x00\x03', (
                '\x0fhttpUri\x06=http://localhost:8000/gateway/\x00',
                '\x0frtmpUri\x06+rtmp://localhost/echo\x00'
            )
        )

        stream = sol.encode(u'EchoTest',
            {u'httpUri': u'http://localhost:8000/gateway/', u'rtmpUri': u'rtmp://localhost/echo'}, encoding=pyamf.AMF3)

        self.assertTrue(check_buffer(stream.getvalue(), bytes))
Ejemplo n.º 5
0
    def test_amf3(self):
        bytes = ('\x00\xbf\x00\x00\x00aTCSO\x00\x04\x00\x00\x00\x00\x00\x08' + \
            'EchoTest\x00\x00\x00\x03', (
                '\x0fhttpUri\x06=http://localhost:8000/gateway/\x00',
                '\x0frtmpUri\x06+rtmp://localhost/echo\x00'
            )
        )

        stream = sol.encode(u'EchoTest',
            {u'httpUri': u'http://localhost:8000/gateway/', u'rtmpUri': u'rtmp://localhost/echo'}, encoding=pyamf.AMF3)

        self.assertTrue(check_buffer(stream.getvalue(), bytes))
Ejemplo n.º 6
0
    def test_amf3(self):
        bytes = '\x00\xbf\x00\x00\x00aTCSO\x00\x04\x00\x00\x00\x00\x00\x08' + \
            'EchoTest\x00\x00\x00\x03\x0fhttpUri\x06=http://localhost:8000' + \
            '/gateway/\x00\x0frtmpUri\x06+rtmp://localhost/echo\x00'

        stream = sol.encode(u'EchoTest', {
            u'httpUri': u'http://localhost:8000/gateway/',
            u'rtmpUri': u'rtmp://localhost/echo'
        },
                            encoding=pyamf.AMF3)

        self.assertEquals(stream.getvalue(), bytes)
Ejemplo n.º 7
0
    def test_amf3(self):
        bytes = (
            "\x00\xbf\x00\x00\x00aTCSO\x00\x04\x00\x00\x00\x00\x00\x08" + "EchoTest\x00\x00\x00\x03",
            ("\x0fhttpUri\x06=http://localhost:8000/gateway/\x00", "\x0frtmpUri\x06+rtmp://localhost/echo\x00"),
        )

        stream = sol.encode(
            u"EchoTest",
            {u"httpUri": u"http://localhost:8000/gateway/", u"rtmpUri": u"rtmp://localhost/echo"},
            encoding=pyamf.AMF3,
        )

        self.assertTrue(check_buffer(stream.getvalue(), bytes))
Ejemplo n.º 8
0
    def test_multiple_values(self):
        stream = sol.encode("hello", {"name": "value", "spam": "eggs"})

        self.assertEquals(stream.getvalue(), HelperTestCase.contents)
Ejemplo n.º 9
0
    def test_encode_header(self):
        stream = sol.encode("hello", {})

        self.assertEquals(
            stream.getvalue(), "\x00\xbf\x00\x00\x00\x15TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello\x00\x00\x00\x00"
        )
Ejemplo n.º 10
0
    def test_multiple_values(self):
        stream = sol.encode('hello', {'name': 'value', 'spam': 'eggs'})

        self.assertTrue(check_buffer(stream.getvalue(), HelperTestCase.contents))
Ejemplo n.º 11
0
    def test_multiple_values(self):
        stream = sol.encode('hello', {'name': 'value', 'spam': 'eggs'})

        self.assertTrue(
            check_buffer(stream.getvalue(), HelperTestCase.contents)
        )