def setUp(self): self.loop = trollius.get_event_loop() self.graph = GraphDatabase("ws://localhost:8182/", username="******", password="******", loop=self.loop, future_class=Future)
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)
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())
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())
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)
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())
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
def test_wrong_protocol_exception(self): graph = GraphDatabase("wss://localhost:8182/") with self.assertRaises(RuntimeError): connection = yield graph.connect()
def test_bad_port_exception(self): graph = GraphDatabase("ws://localhost:81/") with self.assertRaises(RuntimeError): connection = yield graph.connect()
def setUp(self): super(TornadoSessionTest, self).setUp() self.graph = GraphDatabase("ws://localhost:8182/", username="******", password="******")