summaryrefslogtreecommitdiff
path: root/test/t/test_lftp.py
blob: 765e51e1c1688cba534f94ce559a21d3193b9974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pytest

from conftest import assert_bash_exec


@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/lftp",))
class TestLftp:
    @pytest.mark.complete("lftp ")
    def test_1(self, bash, completion):
        hosts = assert_bash_exec(
            bash, "compgen -A hostname", want_output=True
        ).split()
        assert all(x in completion for x in hosts)
        assert "lftptest" in completion  # defined in lftp/.lftp/bookmarks

    @pytest.mark.complete("lftp -", require_cmd=True)
    def test_2(self, completion):
        assert completion