summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_events.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index da2e036..e832056 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -2826,6 +2826,19 @@ else:
get_running_loop_impl = events._c_get_running_loop
get_event_loop_impl = events._c_get_event_loop
+class TestServer(unittest.TestCase):
+
+ def test_get_loop(self):
+ loop = asyncio.new_event_loop()
+ proto = MyProto(loop)
+ server = loop.run_until_complete(loop.create_server(lambda: proto, '0.0.0.0', 0))
+ self.assertEqual(server.get_loop(), loop)
+ loop.close()
+
+class TestAbstractServer(unittest.TestCase):
+
+ def test_get_loop(self):
+ self.assertEqual(events.AbstractServer().get_loop(), NotImplemented)
if __name__ == '__main__':
unittest.main()