MCPcopy
hub / github.com/qtile/qtile / test_prompt

Function test_prompt

test/test_bar.py:122–147  ·  view source on GitHub ↗
(manager, monkeypatch)

Source from the content-addressed store, hash-verified

120
121@gb_config
122def test_prompt(manager, monkeypatch):
123 manager.test_window("one")
124 assert_focused(manager, "one")
125
126 assert manager.c.widget["prompt"].info()["width"] == 0
127 manager.c.spawncmd(":")
128 manager.c.widget["prompt"].fake_keypress("a")
129 manager.c.widget["prompt"].fake_keypress("Tab")
130
131 manager.c.spawncmd(":")
132 manager.c.widget["prompt"].fake_keypress("slash")
133 manager.c.widget["prompt"].fake_keypress("Tab")
134
135 script = Path(__file__).parent / "scripts" / "window.py"
136 manager.c.spawncmd(":", aliases={"w": f"{sys.executable} {script.as_posix()}"})
137 manager.c.widget["prompt"].fake_keypress("w")
138 manager.test_window("two")
139 assert_unfocused(manager, "two")
140 manager.c.widget["prompt"].fake_keypress("Return")
141 assert_focused(manager, "one")
142
143 @Retry(ignore_exceptions=(CommandError,))
144 def is_spawned():
145 return manager.c.window.info()
146
147 is_spawned()
148
149
150@gb_config

Callers

nothing calls this directly

Calls 7

assert_focusedFunction · 0.90
assert_unfocusedFunction · 0.90
test_windowMethod · 0.80
spawncmdMethod · 0.80
fake_keypressMethod · 0.80
is_spawnedFunction · 0.70
infoMethod · 0.45

Tested by

no test coverage detected