Example #1
0
class RemoteConnectionTest(unittest.TestCase):
    def setUp(self):
        super(RemoteConnectionTest, self).setUp()
        self.conn = RemoteConnection("ws://localhost:8182/")

    def tearDown(self):
        super(RemoteConnectionTest, self).tearDown()
        self.conn.close()

    def test_submit(self):
        result = self.conn.submit("gremlin-groovy", "x + x", bindings={"x": 1})
        result = list(result)
        self.assertEqual(result[0].object, 2)

    def test_traversal(self):
        g = PythonGraphTraversalSource(GroovyTranslator("g"),
                                       remote_connection=self.conn)
        node = g.addV('person').property('name', 'stephen').next()
        self.assertTrue(node['properties']['name'][0]['value'], 'stephen')
Example #2
0
class RemoteConnectionTest(unittest.TestCase):

    def setUp(self):
        super(RemoteConnectionTest, self).setUp()
        self.conn = RemoteConnection("ws://localhost:8182/")

    def tearDown(self):
        super(RemoteConnectionTest, self).tearDown()
        self.conn.close()

    def test_submit(self):
        result = self.conn.submit("gremlin-groovy", "x + x", bindings={"x": 1})
        result = list(result)
        self.assertEqual(result[0].object, 2)

    def test_traversal(self):
        g = PythonGraphTraversalSource(GroovyTranslator("g"),
                                       remote_connection=self.conn)
        node = g.addV('person').property('name','stephen').next()
        self.assertTrue(node['properties']['name'][0]['value'], 'stephen')
Example #3
0
 def setUp(self):
     super(RemoteConnectionTest, self).setUp()
     self.conn = RemoteConnection("ws://localhost:8182/")
Example #4
0
 def setUp(self):
     super(RemoteConnectionTest, self).setUp()
     self.conn = RemoteConnection("ws://localhost:8182/")