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")
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")
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")
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")
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")
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'}))
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' }))
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"}), )