Ejemplo n.º 1
0
 def setUp(self):
     self.loop = trollius.get_event_loop()
     self.graph = GraphDatabase("ws://localhost:8182/",
                                username="******",
                                password="******",
                                loop=self.loop,
                                future_class=Future)
Ejemplo n.º 2
0
 def setUp(self):
     super(TornadoSessionTest, self).setUp()
     self.loop = self.get_new_ioloop()
     self.loop.make_current()
     self.graph = GraphDatabase("ws://localhost:8182/",
                                username="******",
                                password="******",
                                future_class=Future)
Ejemplo n.º 3
0
    def test_wrong_protocol_exception(self):
        graph = GraphDatabase(url="wss://localhost:8182/", loop=self.loop,
                              future_class=Future)
        @asyncio.coroutine
        def go():
            with self.assertRaises(RuntimeError):
                connection = yield from graph.connect()

        self.loop.run_until_complete(go())
Ejemplo n.º 4
0
    def test_bad_port_exception(self):
        graph = GraphDatabase(url="ws://localhost:81/",
                              loop=self.loop,
                              future_class=Future)

        async def go():
            with self.assertRaises(RuntimeError):
                connection = await graph.connect()

        self.loop.run_until_complete(go())
Ejemplo n.º 5
0
    def test_wrong_protocol_exception(self):
        graph = GraphDatabase("wss://localhost:8182/",
                              loop=self.loop,
                              future_class=Future)

        async def go():
            with self.assertRaises(RuntimeError):
                connection = await graph.connect()

        self.loop.run_sync(go)
Ejemplo n.º 6
0
    def test_bad_port_exception(self):
        graph = GraphDatabase(url="ws://localhost:81/",
                              loop=self.loop,
                              future_class=Future)

        @trollius.coroutine
        def go():
            with self.assertRaises(RuntimeError):
                connection = yield From(graph.connect())

        self.loop.run_until_complete(go())
Ejemplo n.º 7
0
        def execute(script):
            future = Future()
            graph = GraphDatabase("ws://localhost:8182/",
                                  username="******",
                                  password="******")
            future_conn = graph.connect()

            def cb(f):
                conn = f.result()
                stream = conn.send(script)
                future.set_result(stream)

            future_conn.add_done_callback(cb)

            return future
Ejemplo n.º 8
0
 def test_wrong_protocol_exception(self):
     graph = GraphDatabase("wss://localhost:8182/")
     with self.assertRaises(RuntimeError):
         connection = yield graph.connect()
Ejemplo n.º 9
0
 def test_bad_port_exception(self):
     graph = GraphDatabase("ws://localhost:81/")
     with self.assertRaises(RuntimeError):
         connection = yield graph.connect()
Ejemplo n.º 10
0
 def setUp(self):
     super(TornadoSessionTest, self).setUp()
     self.graph = GraphDatabase("ws://localhost:8182/",
                                username="******",
                                password="******")