diff --git a/aiogremlin/driver/protocol.py b/aiogremlin/driver/protocol.py index 97f1292d82a4b228dac40a88df756c2e9c980f5a..f1f521cbd4f3f36e7305fb7075ca8f63a94649a9 100644 --- a/aiogremlin/driver/protocol.py +++ b/aiogremlin/driver/protocol.py @@ -43,7 +43,7 @@ class GremlinServerWSProtocol(protocol.AbstractBaseProtocol): async def data_received(self, data, results_dict): data = data.decode('utf-8') - message = json.loads(data) + message = self._message_serializer.deserialize_message(json.loads(data)) request_id = message['requestId'] status_code = message['status']['code'] data = message['result']['data'] @@ -65,7 +65,6 @@ class GremlinServerWSProtocol(protocol.AbstractBaseProtocol): else: if data: for result in data: - result = self._message_serializer.deserialize_message(result) message = Message(status_code, result, msg) result_set.queue_result(message) else: diff --git a/tests/test_gremlin_python/driver/test_driver_remote_connection.py b/tests/test_gremlin_python/driver/test_driver_remote_connection.py index 2cdbe84d78da733c5e92684c8427f8dfe995e758..883d4c11ff2e1e6cc0b4160f91401d4c17ac176e 100644 --- a/tests/test_gremlin_python/driver/test_driver_remote_connection.py +++ b/tests/test_gremlin_python/driver/test_driver_remote_connection.py @@ -38,6 +38,7 @@ class TestDriverRemoteConnection(object): statics.load_statics(globals()) g = Graph().traversal().withRemote(remote_connection) result = await g.V().limit(1).toList() + await remote_connection.close() @pytest.mark.asyncio async def test_traversals(self, remote_connection):