(manager, monkeypatch)
| 120 | |
| 121 | @gb_config |
| 122 | def 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 |
nothing calls this directly
no test coverage detected