예제 #1
0
 def test_dumps(self):
     message = {
         'content': '_test_content_'
     }
     data = base.dumps(message)
     message['jsonrpc'] = base.SPEC_VER
     self.assertEqual(json.dumps(message), data)
예제 #2
0
 def _format_response(self, msg):
     data = msg.dumps() if hasattr(msg, 'dumps') else base.dumps(msg)
     return self._response_format % (len(data), data)
예제 #3
0
 def test_dumps(self):
     message = {'content': '_test_content_'}
     data = base.dumps(message)
     message['jsonrpc'] = base.SPEC_VER
     self.assertEqual(json.dumps(message), data)
예제 #4
0
 def _format_response(self, msg):
     data = msg.dumps() if hasattr(msg, 'dumps') else base.dumps(msg)
     return self._response_format % (len(data), data)