X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=tests%2Ftest_rm.py;h=76937e516245f8d8633cab4321d341fc6e46c4a6;hb=HEAD;hp=b9ad1b8b2a9ebeeba0cf124cb48c92c54d0e7d44;hpb=96bc9c67fc993dc918ea80c208096b9523a68f6f;p=ppu.git diff --git a/tests/test_rm.py b/tests/test_rm.py index b9ad1b8..76937e5 100755 --- a/tests/test_rm.py +++ b/tests/test_rm.py @@ -24,6 +24,11 @@ def test_rm(): assert_files_exist('test1') assert_files_not_exist('test2') + assert subprocess.call( + [sys.executable, test_prog_path, "test3"]) == 1 # not exists + assert subprocess.call( + [sys.executable, test_prog_path, "-f", "test3"]) == 0 + def test_rm_recursive(): create_files(['test']) @@ -35,3 +40,8 @@ def test_rm_recursive(): [sys.executable, test_prog_path, "-r", "subdir"]) == 0 assert_files_exist('test') assert_files_not_exist(['subdir/subd2/test']) + + assert subprocess.call( + [sys.executable, test_prog_path, "-r", "test3"]) == 1 # not exists + assert subprocess.call( + [sys.executable, test_prog_path, "-rf", "test3"]) == 0