Commit ce0fb1b0 authored by davebshow's avatar davebshow
Browse files

updating rebindings

parent 6ede0d09
# [aiogremlin 0.0.12](https://pypi.python.org/pypi/aiogremlin/0.0.11)
# [aiogremlin 0.1.0](https://pypi.python.org/pypi/aiogremlin/0.0.11)
## [Official Documentation](http://aiogremlin.readthedocs.org/en/latest/)
......
......@@ -4,4 +4,4 @@ from .exceptions import *
from .connector import *
from .subprotocol import *
__version__ = "0.0.12"
__version__ = "0.1.0"
......@@ -161,6 +161,8 @@ class GremlinClient:
:param dict bindings: A mapping of bindings for Gremlin script.
:param str lang: Language of scripts submitted to the server.
"gremlin-groovy" by default
:param dict rebindings: Rebind ``Graph`` and ``TraversalSource``
objects to different variable names in the current request
:param str op: Gremlin Server op argument. "eval" by default.
:param str processor: Gremlin Server processor argument. "" by default.
:param float timeout: timeout for establishing connection (optional).
......@@ -329,6 +331,7 @@ def submit(gremlin, *,
url='ws://localhost:8182/',
bindings=None,
lang="gremlin-groovy",
rebindings=None,
op="eval",
processor="",
timeout=None,
......@@ -345,6 +348,8 @@ def submit(gremlin, *,
:param dict bindings: A mapping of bindings for Gremlin script.
:param str lang: Language of scripts submitted to the server.
"gremlin-groovy" by default
:param dict rebindings: Rebind ``Graph`` and ``TraversalSource``
objects to different variable names in the current request
:param str op: Gremlin Server op argument. "eval" by default.
:param str processor: Gremlin Server processor argument. "" by default.
:param float timeout: timeout for establishing connection (optional).
......@@ -370,8 +375,8 @@ def submit(gremlin, *,
try:
resp = yield from gremlin_client.submit(
gremlin, bindings=bindings, lang=lang, op=op, processor=processor,
session=session, timeout=timeout)
gremlin, bindings=bindings, lang=lang, rebindings=rebindings,
op=op, processor=processor, session=session, timeout=timeout)
return resp
......
......@@ -62,9 +62,9 @@ author = 'David M. Brown'
# built documents.
#
# The short X.Y version.
version = '0.0.11'
version = '0.1.0'
# The full version, including alpha/beta/rc tags.
release = '0.0.11'
release = '0.1.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -12,7 +12,7 @@ based on the `asyncio`_ and `aiohttp`_ libraries.
Releases
========
The latest release of :py:mod:`aiogremlin` is **0.0.12**.
The latest release of :py:mod:`aiogremlin` is **0.1.0**.
Requirements
......
......@@ -3,7 +3,7 @@ from setuptools import setup
setup(
name="aiogremlin",
version="0.0.12",
version="0.1.0",
url="",
license="MIT",
author="davebshow",
......
......@@ -30,6 +30,25 @@ class SubmitTest(unittest.TestCase):
results = self.loop.run_until_complete(go())
self.assertEqual(results[0].data[0], 8)
def test_rebinding(self):
execute = submit("graph2.addVertex()", loop=self.loop)
try:
self.loop.run_until_complete(execute.get())
error = False
except:
error = True
self.assertTrue(error)
@asyncio.coroutine
def go():
result = yield from submit(
"graph2.addVertex()", rebindings={"graph2": "graph"},
loop=self.loop)
resp = yield from result.get()
self.assertEqual(len(resp), 1)
self.loop.run_until_complete(go())
class GremlinClientTest(unittest.TestCase):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment