mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00

* chore: add pyupgrade * refactor: upgrade code to py3.7+ ran `pre-commit run pyupgrade -a` while excluding changes to ply * fix: flake errors
27 lines
746 B
Python
27 lines
746 B
Python
import os
|
|
import pytest # noqa F401
|
|
from xonsh.completers.man import complete_from_man
|
|
|
|
from tools import skip_if_on_windows
|
|
|
|
from xonsh.parsers.completion_context import (
|
|
CompletionContext,
|
|
CommandContext,
|
|
CommandArg,
|
|
)
|
|
|
|
|
|
@skip_if_on_windows
|
|
def test_man_completion(monkeypatch, tmpdir, xession):
|
|
tempdir = tmpdir.mkdir("test_man")
|
|
monkeypatch.setitem(
|
|
os.environ, "MANPATH", os.path.dirname(os.path.abspath(__file__))
|
|
)
|
|
xession.env.update({"XONSH_DATA_DIR": str(tempdir)})
|
|
completions = complete_from_man(
|
|
CompletionContext(
|
|
CommandContext(args=(CommandArg("yes"),), arg_index=1, prefix="--")
|
|
)
|
|
)
|
|
assert "--version" in completions
|
|
assert "--help" in completions
|