aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_task_runner.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-01-12 23:01:18 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:53 +0100
commit81e98c8b7049fd08886ba7099bba02130b6026a2 (patch)
treef8211fa973ea09f0c3ea918ec97209b543c13241 /tests/test_task_runner.py
parentadf20323ce99e8829a2ab53f8d487f5704d28320 (diff)
downloadwee-slack-81e98c8b7049fd08886ba7099bba02130b6026a2.tar.gz
Remove active_responses
Diffstat (limited to 'tests/test_task_runner.py')
-rw-r--r--tests/test_task_runner.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/test_task_runner.py b/tests/test_task_runner.py
index ca4f78b..095b013 100644
--- a/tests/test_task_runner.py
+++ b/tests/test_task_runner.py
@@ -6,7 +6,7 @@ from slack.task import Future, create_task, weechat_task_cb
def test_run_single_task():
shared.active_tasks = defaultdict(list)
- shared.active_responses = {}
+ shared.active_futures = {}
future = Future[str]()
async def awaitable():
@@ -17,12 +17,13 @@ def test_run_single_task():
weechat_task_cb(future.id, "data")
assert not shared.active_tasks
- assert shared.active_responses == {task.id: ("awaitable", ("data",))}
+ assert not shared.active_futures
+ assert task.result == ("awaitable", ("data",))
def test_run_nested_task():
shared.active_tasks = defaultdict(list)
- shared.active_responses = {}
+ shared.active_futures = {}
future = Future[str]()
async def awaitable1():
@@ -37,14 +38,13 @@ def test_run_nested_task():
weechat_task_cb(future.id, "data")
assert not shared.active_tasks
- assert shared.active_responses == {
- task.id: ("awaitable2", ("awaitable1", ("data",)))
- }
+ assert not shared.active_futures
+ assert task.result == ("awaitable2", ("awaitable1", ("data",)))
def test_run_two_tasks_concurrently():
shared.active_tasks = defaultdict(list)
- shared.active_responses = {}
+ shared.active_futures = {}
future1 = Future[str]()
future2 = Future[str]()
@@ -58,7 +58,6 @@ def test_run_two_tasks_concurrently():
weechat_task_cb(future2.id, "data2")
assert not shared.active_tasks
- assert shared.active_responses == {
- task1.id: ("awaitable", ("data1",)),
- task2.id: ("awaitable", ("data2",)),
- }
+ assert not shared.active_futures
+ assert task1.result == ("awaitable", ("data1",))
+ assert task2.result == ("awaitable", ("data2",))