proxygen
futures.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 import asyncio
3 import unittest
4 
5 from . import simplebridge
6 
7 
8 class Futures(unittest.TestCase):
9  def test_bridge(self):
10  val = 1337
11  loop = asyncio.get_event_loop()
12  res = loop.run_until_complete(simplebridge.get_value_x5(val))
13  self.assertEqual(val * 5, res)
14 
16  loop = asyncio.get_event_loop()
17  with self.assertRaises(ValueError, msg="0 is not allowed"):
18  loop.run_until_complete(simplebridge.get_value_x5(0))
19 
20  def test_bridge_fibers(self):
21  val = 1337
22  loop = asyncio.get_event_loop()
23  res = loop.run_until_complete(simplebridge.get_value_x5_fibers(val))
24  self.assertEqual(val * 5, res)
def test_bridge_fibers(self)
Definition: futures.py:20
def test_bridge_exception(self)
Definition: futures.py:15
def test_bridge(self)
Definition: futures.py:9