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