示例#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)