Пример #1
0
    def test_header(self):
        bytes = "\x00\xbf\x00\x00\x00\x15TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello\x00\x00\x00\x00"

        try:
            sol.decode(bytes)
        except:
            self.fail("Error occurred during decoding stream")
Пример #2
0
    def test_strict_header_length(self):
        bytes = "\x00\xbf\x00\x00\x00\x00TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello\x00\x00\x00\x00"

        try:
            sol.decode(bytes, strict=False)
        except:
            self.fail("Error occurred during decoding stream")
Пример #3
0
    def test_strict_header_length(self):
        bytes = '\x00\xbf\x00\x00\x00\x00TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello\x00\x00\x00\x00'

        try:
            sol.decode(bytes, strict=False)
        except:
            self.fail("Error occurred during decoding stream")
Пример #4
0
    def test_header(self):
        bytes = '\x00\xbf\x00\x00\x00\x15TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello\x00\x00\x00\x00'

        try:
            sol.decode(bytes)
        except:
            self.fail("Error occurred during decoding stream")
Пример #5
0
    def test_header(self):
        bytes = '\x00\xbf\x00\x00\x00\x15TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello\x00\x00\x00\x00'

        try:
            sol.decode(bytes)
        except:
            raise
            self.fail("Error decoding stream")
Пример #6
0
    def test_header(self):
        bytes = '\x00\xbf\x00\x00\x00\x15TCSO\x00\x04\x00\x00\x00\x00\x00\x05hello\x00\x00\x00\x00'

        try:
            sol.decode(bytes)
        except:
            raise
            self.fail("Error decoding stream")
Пример #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'

        self.assertEquals(sol.decode(bytes), (u'EchoTest',
            {u'httpUri': u'http://localhost:8000/gateway/', u'rtmpUri': u'rtmp://localhost/echo'}))
Пример #8
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'

        self.assertEquals(sol.decode(bytes), (u'EchoTest',
            {u'httpUri': u'http://localhost:8000/gateway/', u'rtmpUri': u'rtmp://localhost/echo'}))
Пример #9
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')

        self.assertEqual(sol.decode(bytes), ('EchoTest', {
            'httpUri': 'http://localhost:8000/gateway/',
            'rtmpUri': 'rtmp://localhost/echo'
        }))
Пример #10
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"
        )

        self.assertEquals(
            sol.decode(bytes),
            (u"EchoTest", {u"httpUri": u"http://localhost:8000/gateway/", u"rtmpUri": u"rtmp://localhost/echo"}),
        )