]> git.phdru.name Git - ppu.git/blob - tests/test_which.py
Tests: Remove unused tmp_dir
[ppu.git] / tests / test_which.py
1 #! /usr/bin/env python
2
3 import os
4 import subprocess
5 import sys
6 from ppu_tu import setup, teardown, find_in_path  # noqa
7
8
9 test_prog_path = find_in_path('which.py')
10 if not test_prog_path:
11     sys.exit("Cannot find which.py in %s" % os.environ["PATH"])
12
13
14 def test_which():
15     assert subprocess.check_output(
16         [sys.executable, test_prog_path, "which.py"],
17         universal_newlines=True).strip() == test_prog_path
18     assert subprocess.check_output(
19         [sys.executable, test_prog_path, "WhoWhereWhenceWhichWhereIs.py"],
20         universal_newlines=True).strip() == ''