diff options
| author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2019-08-07 09:17:13 -0300 |
|---|---|---|
| committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2019-08-07 09:17:13 -0300 |
| commit | 5732da2af736c40cf693354485446ab4867ecb4d (patch) | |
| tree | 76d76cdfa16ca62d20fb109da13895ec64fff110 /test/t/test_ssh.py | |
| parent | 9cd22d1df8f0f5b554858471c86faa9f37b8fed4 (diff) | |
| download | bash-completion-upstream/2.9.tar.gz | |
New upstream version 2.9upstream/2.9
Diffstat (limited to 'test/t/test_ssh.py')
| -rw-r--r-- | test/t/test_ssh.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py new file mode 100644 index 00000000..97a4a733 --- /dev/null +++ b/test/t/test_ssh.py @@ -0,0 +1,30 @@ +import pytest + + +class TestSsh: + @pytest.mark.complete("ssh -Fsp", cwd="ssh") + def test_1(self, completion): + assert completion == "-Fspaced conf" + + @pytest.mark.complete("ssh -F config ls", cwd="ssh") + def test_2(self, completion): + """Should complete both commands and hostname.""" + assert all(x in completion for x in "ls ls_known_host".split()) + + @pytest.mark.complete("ssh bash", cwd="ssh") + def test_3(self, completion): + """ + First arg should not complete with commands. + + Assumes there's no "bash" known host. + """ + assert "bash" not in completion + + @pytest.mark.complete("ssh -vo AddressFamily=") + def test_4(self, completion): + assert completion + + @pytest.mark.xfail # TODO our test facilities don't support case change? + @pytest.mark.complete("ssh -vo userknownhostsf") + def test_5(self, completion): + assert "UserKnownHostsFile=" in completion |
