X-Git-Url: https://git.phdru.name/?p=ppu.git;a=blobdiff_plain;f=tests%2Ftest_rm.py;h=4e4cd76d314412f7fc2c1215f3832965aa0a73f4;hp=631502cfe096c4531cfd2f80364bbcaafa4f8662;hb=129068b91b9f880672fe17c248c8085d8589fce7;hpb=c9b64e869f9e673b0d213be3f7d098ef00e4fe1c diff --git a/tests/test_rm.py b/tests/test_rm.py index 631502c..4e4cd76 100755 --- a/tests/test_rm.py +++ b/tests/test_rm.py @@ -21,3 +21,22 @@ def test_rm(): [sys.executable, test_prog_path, "test2"]) == 0 assert_files_exist('test1') assert_files_not_exist('test2') + + create_files(['test1', 'test2']) + assert_files_exist(['test1', 'test2']) + assert subprocess.call( + [sys.executable, test_prog_path, "-r", "test2"]) == 0 + assert_files_exist('test1') + assert_files_not_exist('test2') + + +def test_rm_recursive(): + create_files(['test']) + create_files(['test'], 'subdir/subd2') + assert_files_exist(['test', 'subdir/subd2/test']) + assert subprocess.call( + [sys.executable, test_prog_path, "subdir"]) == 1 + assert subprocess.call( + [sys.executable, test_prog_path, "-r", "subdir"]) == 0 + assert_files_exist('test') + assert_files_not_exist(['subdir/subd2/test'])