summaryrefslogtreecommitdiffstats
path: root/test/t/test_printenv.py
blob: 8384ec05993be0778bb3dbbda56710dcc6bab9b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pytest


class TestPrintenv:
    @pytest.mark.complete("printenv ")
    def test_empty(self, completion):
        assert completion

    @pytest.mark.complete("printenv PAT")
    def test_path(self, completion):
        assert completion == "H" or "PATH" in completion

    @pytest.mark.complete(
        "printenv -",
        require_cmd=True,
        xfail="! printenv --help 2>&1 | command grep -q '^[[:space:]]*-'",
    )
    def test_options(self, completion):
        assert completion