File: test_leaves.py

package info (click to toggle)
python-i3ipc 2.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 580 kB
  • sloc: python: 2,968; makefile: 222; sh: 4
file content (18 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from .ipctest import IpcTest

import pytest


class TestLeaves(IpcTest):
    @pytest.mark.asyncio
    async def test_workspace_leaves(self, i3):
        ws_name = await self.fresh_workspace()
        con1 = self.open_window()
        await self.command_checked(f'[id={con1}] floating enable')
        self.open_window()
        self.open_window()

        tree = await i3.get_tree()
        ws = [w for w in tree.workspaces() if w.name == ws_name][0]

        assert (len(ws.leaves()) == 3)