]> git.phdru.name Git - ppu.git/blob - tests/test_rm.py
Add rm.py
[ppu.git] / tests / test_rm.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 from ppu_tu import create_files, assert_files_exist, assert_files_not_exist
8
9
10 tmp_dir = None
11
12 test_prog_path = find_in_path('rm.py')
13 if not test_prog_path:
14     sys.exit("Cannot find rm.py in %s" % os.environ["PATH"])
15
16
17 def test_rm():
18     create_files(['test1', 'test2'])
19     assert_files_exist(['test1', 'test2'])
20     assert subprocess.call(
21         [sys.executable, test_prog_path, "test2"]) == 0
22     assert_files_exist('test1')
23     assert_files_not_exist('test2')