missing test file
This commit is contained in:
parent
1cdb4bc9e7
commit
aaa9982932
1 changed files with 11 additions and 0 deletions
|
@ -1,4 +1,7 @@
|
||||||
|
import asyncio
|
||||||
|
|
||||||
from torba.stream import StreamController
|
from torba.stream import StreamController
|
||||||
|
from torba.tasks import TaskGroup
|
||||||
from torba.testcase import AsyncioTestCase
|
from torba.testcase import AsyncioTestCase
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,3 +21,11 @@ class StreamControllerTestCase(AsyncioTestCase):
|
||||||
controller.add("yo")
|
controller.add("yo")
|
||||||
controller.add("yo")
|
controller.add("yo")
|
||||||
self.assertListEqual(events, ["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())
|
Loading…
Add table
Reference in a new issue