xonsh/tests/test_man.py
Bob Hyman 26475146e2
Flake8 1 (#3550)
* flake8 fixes -- tests only

* fix ci failure

* integrate fix from is_3551 so tests will pass.

* Update tests/test_builtins.py

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2020-05-05 06:42:28 -04:00

18 lines
613 B
Python

# -*- coding: utf-8 -*-
import os
import pytest # noqa F401
from xonsh.completers.man import complete_from_man
from tools import skip_if_on_windows
@skip_if_on_windows
def test_man_completion(monkeypatch, tmpdir, xonsh_builtins):
tempdir = tmpdir.mkdir("test_man")
monkeypatch.setitem(
os.environ, "MANPATH", os.path.dirname(os.path.abspath(__file__))
)
xonsh_builtins.__xonsh__.env.update({"XONSH_DATA_DIR": str(tempdir)})
completions = complete_from_man("--", "yes --", 4, 6, xonsh_builtins.__xonsh__.env)
assert "--version" in completions
assert "--help" in completions