7 from tempfile import mkdtemp
8 from find_in_path import find_in_path
13 test_prog_path = find_in_path('cmp.py')
14 if not test_prog_path:
15 sys.exit("Cannot find cmp.py in %s" % os.environ["PATH"])
25 os.chdir(os.sep) # To the root of the FS
26 shutil.rmtree(tmp_dir)
29 def create_file(name, content):
30 with open(name, 'w') as fp:
35 create_file('test1', 'test')
36 create_file('test2', 'test')
37 assert subprocess.call(
38 [sys.executable, test_prog_path, "-i", "test1", "test2"]) == 0
40 create_file('test3', 'test3')
41 create_file('test4', 'test4')
42 assert subprocess.call(
43 [sys.executable, test_prog_path, "-i", "test3", "test4"]) == 1