Merge branch 'TINKERPOP-1448'
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/687ae742 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/687ae742 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/687ae742 Branch: refs/heads/TINKERPOP-1442-master Commit: 687ae742d974482881e52c5c05a608d99020383d Parents: 2790dbb 1c5e698 Author: davebshow <davebs...@apache.org> Authored: Thu Sep 15 12:14:54 2016 -0400 Committer: davebshow <davebs...@apache.org> Committed: Thu Sep 15 12:14:54 2016 -0400 ---------------------------------------------------------------------- .../python/GraphTraversalSourceGenerator.groovy | 5 +++-- .../gremlin/python/TraversalSourceGenerator.groovy | 5 ++++- .../driver/driver_remote_connection.py | 2 +- .../gremlin_python/driver/remote_connection.py | 2 +- .../gremlin_python/process/graph_traversal.py | 3 ++- .../jython/gremlin_python/process/traversal.py | 6 +++++- .../src/main/jython/gremlin_python/statics.py | 17 +++++++++++++++++ .../jython/gremlin_python/structure/io/graphson.py | 10 +++++----- gremlin-python/src/main/jython/setup.py | 11 ++++++++++- .../tests/driver/test_driver_remote_connection.py | 12 ++++++------ .../jython/tests/structure/io/test_graphson.py | 16 +++++++++++----- .../src/main/jython/tests/structure/test_graph.py | 12 ++++++++---- 12 files changed, 73 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/687ae742/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/687ae742/gremlin-python/src/main/jython/gremlin_python/process/traversal.py ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/687ae742/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py ---------------------------------------------------------------------- diff --cc gremlin-python/src/main/jython/tests/structure/io/test_graphson.py index 6f244f5,675b060..99c9a45 --- a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py +++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py @@@ -83,15 -88,11 +89,15 @@@ class TestGraphSONReader(TestCase) class TestGraphSONWriter(TestCase): def test_numbers(self): - assert """{"@type":"g:Int32","@value":1}""" == GraphSONWriter.writeObject(1) - assert """{"@type":"g:Int64","@value":2}""" == GraphSONWriter.writeObject(2L) - assert """{"@type":"g:Float","@value":3.2}""" == GraphSONWriter.writeObject(3.2) + assert {"@type":"g:Int64","@value":2} == json.loads(GraphSONWriter.writeObject(long(2))) + assert {"@type":"g:Int32","@value":1} == json.loads(GraphSONWriter.writeObject(1)) + assert {"@type":"g:Float","@value":3.2} == json.loads(GraphSONWriter.writeObject(3.2)) assert """true""" == GraphSONWriter.writeObject(True) + def test_P(self): + assert """{"@type":"g:P","@value":{"predicate":"and","value":[{"@type":"g:P","@value":{"predicate":"or","value":[{"@type":"g:P","@value":{"predicate":"lt","value":"b"}},{"@type":"g:P","@value":{"predicate":"gt","value":"c"}}]}},{"@type":"g:P","@value":{"predicate":"neq","value":"d"}}]}}""" == GraphSONWriter.writeObject( + P.lt("b").or_(P.gt("c")).and_(P.neq("d"))) + if __name__ == '__main__': unittest.main()