]> git.phdru.name Git - ppu.git/blob - tests/test_which.py
Version 0.4.0: Add script which.py
[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 tmp_dir = None
10
11 test_prog_path = find_in_path('which.py')
12 if not test_prog_path:
13     sys.exit("Cannot find which.py in %s" % os.environ["PATH"])
14
15
16 def test_which():
17     assert subprocess.check_output(
18         [sys.executable, test_prog_path, "which.py"],
19         universal_newlines=True).strip() == test_prog_path
20     assert subprocess.check_output(
21         [sys.executable, test_prog_path, "WhoWhereWhenceWhichWhereIs.py"],
22         universal_newlines=True).strip() == ''