summaryrefslogtreecommitdiffstats
path: root/test/t/test_look.py
blob: fd6800e5a3892576e77177b4434aa0ed0f0e6414 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import subprocess

import pytest


class TestLook:
    @pytest.mark.complete("look foo")
    def test_1(self, completion):
        try:
            subprocess.check_call(
                "look foo 2>/dev/null | command grep -q ^foo", shell=True
            )
        except BaseException:
            assert not completion
        else:
            assert completion