File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 44import asyncio
55from i3ipc import Event
66
7+ events = asyncio .Queue ()
78
89class TestWorkspace (IpcTest ):
9- event = None
1010
11- def on_workspace (self , i3 , e ):
12- TestWorkspace .event = e
13- i3 .main_quit ()
11+ async def on_workspace (self , i3 , e ):
12+ await events .put (e )
1413
1514 @pytest .mark .asyncio
1615 async def test_workspace (self , i3 ):
1716 await i3 .command ('workspace 0' )
1817 await i3 .subscribe ([Event .WORKSPACE ])
19- i3 .on (Event .WORKSPACE_INIT , self .on_workspace )
20- asyncio .ensure_future (i3 .command ('workspace 12' ))
21- await i3 .main ()
18+ i3 .on (Event .WORKSPACE_FOCUS , self .on_workspace )
19+ await i3 .command ('workspace 12' )
20+ e = await events .get ()
21+
2222 workspaces = await i3 .get_workspaces ()
2323
2424 assert len (workspaces ) == 1
2525 ws = workspaces [0 ]
2626 assert ws .name == '12'
2727
28- e = TestWorkspace .event
2928 assert e is not None
3029 assert e .current .name == '12'
You can’t perform that action at this time.
0 commit comments