Skip to content

Commit

Permalink
test: Convert some more test cases to pytest+pexpect
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Jul 7, 2018
1 parent 649cd43 commit aece7ad
Show file tree
Hide file tree
Showing 25 changed files with 146 additions and 264 deletions.
1 change: 0 additions & 1 deletion test/completion/configure.exp

This file was deleted.

1 change: 0 additions & 1 deletion test/completion/cvs.exp

This file was deleted.

1 change: 0 additions & 1 deletion test/completion/cvsps.exp

This file was deleted.

1 change: 0 additions & 1 deletion test/completion/feh.exp

This file was deleted.

1 change: 0 additions & 1 deletion test/completion/fio.exp

This file was deleted.

1 change: 0 additions & 1 deletion test/completion/mencoder.exp

This file was deleted.

1 change: 0 additions & 1 deletion test/completion/mplayer.exp

This file was deleted.

1 change: 0 additions & 1 deletion test/completion/ssh-copy-id.exp

This file was deleted.

24 changes: 0 additions & 24 deletions test/lib/completions/configure.exp

This file was deleted.

41 changes: 0 additions & 41 deletions test/lib/completions/cvs.exp

This file was deleted.

36 changes: 0 additions & 36 deletions test/lib/completions/cvsps.exp

This file was deleted.

57 changes: 0 additions & 57 deletions test/lib/completions/feh.exp

This file was deleted.

22 changes: 0 additions & 22 deletions test/lib/completions/fio.exp

This file was deleted.

25 changes: 0 additions & 25 deletions test/lib/completions/mencoder.exp

This file was deleted.

25 changes: 0 additions & 25 deletions test/lib/completions/mplayer.exp

This file was deleted.

26 changes: 0 additions & 26 deletions test/lib/completions/ssh-copy-id.exp

This file was deleted.

8 changes: 8 additions & 0 deletions test/t/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ EXTRA_DIST = \
test_complete.py \
test_composite.py \
test_config_list.py \
test_configure.py \
test_conjure.py \
test_convert.py \
test_co.py \
Expand All @@ -93,6 +94,8 @@ EXTRA_DIST = \
test_csplit.py \
test_curl.py \
test_cut.py \
test_cvsps.py \
test_cvs.py \
test_date.py \
test_dd.py \
test_declare.py \
Expand Down Expand Up @@ -132,11 +135,13 @@ EXTRA_DIST = \
test_faillog.py \
test_fbgs.py \
test_fbi.py \
test_feh.py \
test_filefrag.py \
test_file.py \
test_file-roller.py \
test_filesnarf.py \
test_find_member.py \
test_fio.py \
test_fmt.py \
test_fold.py \
test_freebsd-update.py \
Expand Down Expand Up @@ -290,6 +295,7 @@ EXTRA_DIST = \
test_mdecrypt.py \
test_mdtool.py \
test_medusa.py \
test_mencoder.py \
test_mii-diag.py \
test_mii-tool.py \
test_minicom.py \
Expand All @@ -304,6 +310,7 @@ EXTRA_DIST = \
test_mogrify.py \
test_monodevelop.py \
test_montage.py \
test_mplayer.py \
test_msgsnarf.py \
test_msynctool.py \
test_mtx.py \
Expand Down Expand Up @@ -456,6 +463,7 @@ EXTRA_DIST = \
test_spovray.py \
test_sqlite3.py \
test_ssh-add.py \
test_ssh-copy-id.py \
test_ssh-keygen.py \
test_sshmitm.py \
test_sshow.py \
Expand Down
16 changes: 16 additions & 0 deletions test/t/test_configure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest


@pytest.mark.pre_commands(
# Make sure our own ./configure is in PATH
"PATH+=:$PWD/../..",
)
class TestConfigure(object):

@pytest.mark.complete("configure --")
def test_1(self, completion):
assert completion.list

@pytest.mark.complete("configure --prefix ")
def test_2(self, completion):
assert completion.list
19 changes: 19 additions & 0 deletions test/t/test_cvs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest


@pytest.mark.pre_commands(
"HOME=$PWD/cvs",
)
class TestCvs(object):

@pytest.mark.complete("cvs ")
def test_1(self, completion):
assert completion.list

@pytest.mark.complete("cvs -d ")
def test_2(self, completion):
assert [x for x in completion.list if ":pserver:" in x]

@pytest.mark.complete("cvs diff foo/", cwd="cvs")
def test_3(self, completion):
assert completion.list == ["foo/bar"]
15 changes: 15 additions & 0 deletions test/t/test_cvsps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pytest


@pytest.mark.pre_commands(
"HOME=$PWD/cvs",
)
class TestCvsps(object):

@pytest.mark.complete("cvsps -")
def test_1(self, completion):
assert completion.list

@pytest.mark.complete("cvsps ")
def test_2(self, completion):
assert [x for x in completion.list if ":pserver:" in x]
Loading

0 comments on commit aece7ad

Please sign in to comment.