Skip to content

Commit

Permalink
test: Convert remaining man test case to pytest+pexpect
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Feb 9, 2019
1 parent cd2b18a commit c10ece5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 32 deletions.
32 changes: 0 additions & 32 deletions test/lib/completions/man.exp

This file was deleted.

18 changes: 18 additions & 0 deletions test/t/test_man.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ class TestMan:
manpath = "$PWD/man"
assumed_present = "man"

@pytest.fixture
def colonpath(self, request, bash):
try:
assert_bash_exec(bash, "uname -s 2>&1 | grep -qiF cygwin")
except AssertionError:
pass
else:
pytest.skip("Cygwin doesn't like paths with colons")
return
assert_bash_exec(bash, "mkdir -p $TESTDIR/../tmp/man/man3")
assert_bash_exec(
bash, "touch $TESTDIR/../tmp/man/man3/Bash::Completion.3pm.gz")

@pytest.mark.complete("man bash-completion-testcas",
env=dict(MANPATH=manpath))
def test_1(self, completion):
Expand Down Expand Up @@ -69,3 +82,8 @@ def test_8(self, completion):
def test_9(self, bash, completion):
assert self.assumed_present in completion
assert_bash_exec(bash, "shopt -u failglob")

@pytest.mark.complete("man Bash::C",
env=dict(MANPATH="%s:../tmp/man" % manpath))
def test_10(self, bash, colonpath, completion):
assert completion == "Bash::Completion"

0 comments on commit c10ece5

Please sign in to comment.