This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 96f5609637018dfc13ff19efa78c397e4b757152 Merge: d0838e2 b5b3bd7 Author: stephen <[email protected]> AuthorDate: Thu Nov 7 07:31:31 2019 -0500 Merge branch 'tp34' .travis.yml | 15 ++++++++------- CHANGELOG.asciidoc | 1 + gremlin-python/src/main/jython/setup.py | 2 +- .../jython/tests/driver/test_driver_remote_connection.py | 14 -------------- 4 files changed, 10 insertions(+), 22 deletions(-) diff --cc gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py index db4398f,dbb0046..1865e9f --- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py +++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py @@@ -188,17 -188,113 +188,3 @@@ class TestDriverRemoteConnection(object assert False except GremlinServerError as gse: assert gse.status_code == 500 -- - def test_side_effects(self, remote_connection): - statics.load_statics(globals()) - # - g = traversal().withRemote(remote_connection) - ### - t = g.V().hasLabel("project").name.iterate() - assert 0 == len(t.side_effects.keys()) - with pytest.raises(Exception): - m = t.side_effects["m"] - ### - t = g.V().out("created").groupCount("m").by("name") - results = t.toSet() - assert 2 == len(results) - assert Vertex(3) in results - assert Vertex(5) in results - assert 1 == len(t.side_effects.keys()) - assert "m" in t.side_effects.keys() - m = t.side_effects["m"] - assert isinstance(m, dict) - assert 2 == len(m) - assert 3 == m["lop"] - assert 1 == m["ripple"] -- - def test_in_tornado_app(): - # Make sure nothing weird with loops - @gen.coroutine - def go(): - conn = DriverRemoteConnection('ws://localhost:45940/gremlin', 'gmodern', pool_size=4) - g = traversal().withRemote(conn) - yield gen.sleep(0) - assert len(g.V().toList()) == 6 - conn.close() - # check status attributes - assert "host" in t.side_effects.status_attributes -- - io_loop = ioloop.IOLoop.current() - io_loop.run_sync(go) - ## - t = g.V().out("created").groupCount("m").by("name").name.aggregate("n") - results = t.toSet() - assert 2 == len(results) - assert "lop" in results - assert "ripple" in results - assert 2 == len(t.side_effects.keys()) - assert "m" in t.side_effects.keys() - assert "n" in t.side_effects.keys() - n = t.side_effects.get("n") - assert isinstance(n, dict) - assert 2 == len(n) - assert "lop" in n.keys() - assert "ripple" in n.keys() - assert 3 == n["lop"] - assert 1 == n["ripple"] - - t = g.withSideEffect('m', 32).V().map(lambda: "x: x.sideEffects('m')") - results = t.toSet() - assert 1 == len(results) - assert 32 == list(results)[0] - assert 32 == t.side_effects['m'] - assert 1 == len(t.side_effects.keys()) - with pytest.raises(Exception): - x = t.side_effects["x"] - - a = g.V().has("name", "marko").next() - b = g.V().has("name", "peter").next() - edge = g.withSideEffect("b", b).V(a).addE("knows").to("b").next() - assert "knows" == edge.label - assert a == edge.outV - assert b == edge.inV - g.V().has("name", "marko").outE("knows").where(__.inV().has("name", "peter")).drop().iterate() - ## - edge = g.withSideEffect("a", a).withSideEffect("b", b).V().limit(1).addE("knows").from_("a").to("b").next() - assert "knows" == edge.label - assert a == edge.outV - assert b == edge.inV - g.V().has("name", "marko").outE("knows").where(__.inV().has("name", "peter")).drop().iterate() - - def test_side_effect_close(self, remote_connection): - g = traversal().withRemote(remote_connection) - t = g.V().aggregate('a').aggregate('b') - t.toList() - - # The 'a' key should return some side effects - results = t.side_effects.get('a') - assert results - - # Close result is None - results = t.side_effects.close() - assert not results - - # Shouldn't get any new info from server - # 'b' isn't in local cache - results = t.side_effects.get('b') - assert not results - - # But 'a' should still be cached locally - results = t.side_effects.get('a') - assert results - - # 'a' should have been added to local keys cache, but not 'b' - results = t.side_effects.keys() - assert len(results) == 1 - a, = results - assert a == 'a' - - # Try to get 'b' directly from server, should throw error - with pytest.raises(Exception): - t.side_effects.value_lambda('b') - - def test_promise(self, remote_connection): - g = traversal().withRemote(remote_connection) - future = g.V().aggregate('a').promise() - t = future.result() - assert len(t.toList()) == 6 - a, = t.side_effects.keys() - assert a == 'a' - results = t.side_effects.get('a') - assert results - results = t.side_effects.close() - assert not results
