def _test(self, inp: str, exp: str) -> None: res = find_unique_completion_pair(inp.split()) if exp: part, cont = exp.split() assert res == (part, part + cont) else: assert not exp
def test_3(self, bash): """~part should complete to ~full<SPACE> if home dir does not exist.""" res = assert_bash_exec(bash, "for u in $(compgen -u); do " "eval test -d ~$u || echo $u; unset u; done", want_output=True).strip().split() part_full = find_unique_completion_pair(res) if not part_full: pytest.skip("No suitable test user found") return part, full = part_full completion = assert_complete(bash, "ls ~%s" % part) assert completion.list == ["~%s" % full] assert completion.line.endswith(" ")
def test_3(self, bash): """~part should complete to ~full<SPACE> if home dir does not exist.""" res = assert_bash_exec( bash, "for u in $(compgen -u); do " "eval test -d ~$u || echo $u; unset u; done", want_output=True).strip().split() part_full = find_unique_completion_pair(res) if not part_full: pytest.skip("No suitable test user found") return part, full = part_full completion = assert_complete(bash, "ls ~%s" % part) assert completion.list == ["~%s" % full] assert completion.line.endswith(" ")