missing test file

This commit is contained in:
Victor Shyba 2019-12-11 19:31:45 -03:00 committed by Lex Berezhny
parent 1cdb4bc9e7
commit aaa9982932

View file

@ -1,4 +1,7 @@
import asyncio
from torba.stream import StreamController
from torba.tasks import TaskGroup
from torba.testcase import AsyncioTestCase
@ -18,3 +21,11 @@ class StreamControllerTestCase(AsyncioTestCase):
controller.add("yo")
controller.add("yo")
self.assertListEqual(events, ["yo"])
class TaskGroupTestCase(AsyncioTestCase):
async def test_stop_empty_set(self):
group = TaskGroup()
group.cancel()
await asyncio.wait_for(group.done.wait(), timeout=0.5)
self.assertTrue(group.done.is_set())