Exemplo n.º 1
0
 async def test_traversal_source_generation(self, app, person_class,
                                            knows_class):
     session = await app.session()
     traversal = session.traversal(person_class)
     translator = GroovyTranslator('g')
     assert translator.translate(traversal.bytecode) == 'g.V().hasLabel("person")'
     traversal = session.traversal(knows_class)
     assert translator.translate(traversal.bytecode) == 'g.E().hasLabel("knows")'
     await app.close()
Exemplo n.º 2
0
 def eval(self, args):
     gremlin = args['gremlin']
     if isinstance(gremlin, Bytecode):
         translator = GroovyTranslator('g')
         args['gremlin'] = translator.translate(gremlin)
         args['bindings'] = gremlin.bindings
     return args
Exemplo n.º 3
0
 def eval(self, args):
     gremlin = args['gremlin']
     if isinstance(gremlin, Bytecode):
         translator = GroovyTranslator('g')
         args['gremlin'] = translator.translate(gremlin)
         args['bindings'] = gremlin.bindings
     return args