diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
commit | 95623d39d6029ba78ec96ad5ea08e9ac12629b91 (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /test/t/test_ssh_keygen.py | |
parent | 019f3cc463db63abc6460f97deb488deec43840b (diff) | |
download | bash-completion-3f3e0627fa0e1521391adec3d037f6f57772c8a1.tar.gz |
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'test/t/test_ssh_keygen.py')
-rw-r--r-- | test/t/test_ssh_keygen.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test/t/test_ssh_keygen.py b/test/t/test_ssh_keygen.py index 2d53f5f8..b773ab4f 100644 --- a/test/t/test_ssh_keygen.py +++ b/test/t/test_ssh_keygen.py @@ -6,3 +6,54 @@ class TestSshKeygen: @pytest.mark.complete("ssh-keygen -", require_cmd=True) def test_1(self, completion): assert completion + + @pytest.mark.complete("ssh-keygen -s foo_key ssh-copy-id/.ssh/") + def test_filedir_pub_at_end_of_s(self, completion): + assert completion + assert all(x.endswith(".pub") for x in completion) + + @pytest.mark.complete("ssh-keygen -s foo_key -n foo,") + def test_usernames_for_n(self, completion): + assert completion + assert not any("," in x for x in completion) + # TODO check that these are usernames + + @pytest.mark.complete("ssh-keygen -s foo_key -h -n foo,") + def test_host_for_h_n(self, completion): + assert completion + assert not any("," in x for x in completion) + # TODO check that these are hostnames + + @pytest.mark.complete("ssh-keygen -Y foo -n ") + def test_n_with_Y(self, completion): + assert not completion + + @pytest.mark.complete("ssh-keygen -r ") + def test_r_without_Y(self, completion): + assert not completion + + @pytest.mark.complete("ssh-keygen -Y foo -r ") + def test_r_with_Y(self, completion): + assert "ssh/" in completion + + @pytest.mark.complete("ssh-keygen -t ecdsa -b ") + def test_ecdsa_b(self, completion): + assert completion + + @pytest.mark.complete("ssh-keygen -t ecdsa-sk -b ") + def test_ecdsa_sk_b(self, completion): + assert not completion + + @pytest.mark.complete("ssh-keygen -O ") + def test_O(self, completion): + assert completion + assert any(x.endswith("=") for x in completion) + + @pytest.mark.complete("ssh-keygen -O force-command=bas") + def test_O_force_command(self, completion): + assert completion + assert not completion.startswith("force-command=") + + @pytest.mark.complete("ssh-keygen -O unknown=") + def test_O_unknown(self, completion): + assert not completion |