summaryrefslogtreecommitdiff
path: root/test/t/test_man.py
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-01-24 19:24:09 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-01-24 19:24:09 -0300
commit019f3cc463db63abc6460f97deb488deec43840b (patch)
tree08cd5387d6c8af6f688d6468c7e2ae9f25c449be /test/t/test_man.py
parent5732da2af736c40cf693354485446ab4867ecb4d (diff)
downloadbash-completion-019f3cc463db63abc6460f97deb488deec43840b.tar.gz
New upstream version 2.10upstream/2.10
Diffstat (limited to 'test/t/test_man.py')
-rw-r--r--test/t/test_man.py31
1 files changed, 24 insertions, 7 deletions
diff --git a/test/t/test_man.py b/test/t/test_man.py
index 60021d99..ad36d96e 100644
--- a/test/t/test_man.py
+++ b/test/t/test_man.py
@@ -2,10 +2,12 @@ import os
import pytest
-from conftest import assert_bash_exec, in_docker
+from conftest import assert_bash_exec, in_container
-@pytest.mark.bashcomp(ignore_env=r"^[+-]MANPATH=")
+@pytest.mark.bashcomp(
+ ignore_env=r"^[+-]((BASHOPTS|MANPATH)=|shopt -. failglob)"
+)
class TestMan:
manpath = "$PWD/man"
@@ -29,7 +31,9 @@ class TestMan:
)
@pytest.mark.complete(
- "man bash-completion-testcas", env=dict(MANPATH=manpath)
+ "man bash-completion-testcas",
+ env=dict(MANPATH=manpath),
+ require_cmd=True,
)
def test_1(self, completion):
assert completion == "bash-completion-testcase"
@@ -43,7 +47,7 @@ class TestMan:
assert completion == "man/quux.8"
@pytest.mark.xfail(
- in_docker() and os.environ.get("DIST") == "centos6",
+ in_container() and os.environ.get("DIST") == "centos6",
reason="TODO: Fails in CentOS for some reason, unknown "
"how to trigger same behavior as tests show (is "
"different and correct when tried manually, but here "
@@ -64,6 +68,7 @@ class TestMan:
@pytest.mark.complete(
"man %s" % assumed_present,
+ require_cmd=True,
cwd="shared/empty_dir",
env=dict(MANPATH="%s:" % manpath),
)
@@ -72,13 +77,16 @@ class TestMan:
assert completion
@pytest.mark.complete(
- "man bash-completion-testcas", env=dict(MANPATH="%s:" % manpath)
+ "man bash-completion-testcas",
+ require_cmd=True,
+ env=dict(MANPATH="%s:" % manpath),
)
def test_6(self, completion):
assert completion == "bash-completion-testcase"
@pytest.mark.complete(
"man %s" % assumed_present,
+ require_cmd=True,
cwd="shared/empty_dir",
env=dict(MANPATH=":%s" % manpath),
)
@@ -87,13 +95,16 @@ class TestMan:
assert completion
@pytest.mark.complete(
- "man bash-completion-testcas", env=dict(MANPATH=":%s" % manpath)
+ "man bash-completion-testcas",
+ require_cmd=True,
+ env=dict(MANPATH=":%s" % manpath),
)
def test_8(self, completion):
assert completion == "bash-completion-testcase"
@pytest.mark.complete(
"man %s" % assumed_present,
+ require_cmd=True,
cwd="shared/empty_dir",
pre_cmds=("shopt -s failglob",),
)
@@ -102,7 +113,13 @@ class TestMan:
assert_bash_exec(bash, "shopt -u failglob")
@pytest.mark.complete(
- "man Bash::C", env=dict(MANPATH="%s:../tmp/man" % manpath)
+ "man Bash::C",
+ require_cmd=True,
+ env=dict(MANPATH="%s:../tmp/man" % manpath),
)
def test_10(self, bash, colonpath, completion):
assert completion == "Bash::Completion"
+
+ @pytest.mark.complete("man -", require_cmd=True)
+ def test_11(self, completion):
+ assert completion