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')
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' )
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)
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))
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)
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))
def test_multiple_values(self): stream = sol.encode("hello", {"name": "value", "spam": "eggs"}) self.assertEquals(stream.getvalue(), HelperTestCase.contents)
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" )
def test_multiple_values(self): stream = sol.encode('hello', {'name': 'value', 'spam': 'eggs'}) self.assertTrue(check_buffer(stream.getvalue(), HelperTestCase.contents))
def test_multiple_values(self): stream = sol.encode('hello', {'name': 'value', 'spam': 'eggs'}) self.assertTrue( check_buffer(stream.getvalue(), HelperTestCase.contents) )