X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=tests%2Ftest_remove_old_files.py;h=67da601952463f0c5379af8614b0b371aa7332f7;hb=9e09c7ca4012167f674e50fc834d6c10de2431d2;hp=e50b6fad711e5dbe2642b5b4c6f28c028da978d6;hpb=f753377d712c7af64ae840d82923d566b2c7bc8c;p=ppu.git diff --git a/tests/test_remove_old_files.py b/tests/test_remove_old_files.py index e50b6fa..67da601 100755 --- a/tests/test_remove_old_files.py +++ b/tests/test_remove_old_files.py @@ -61,3 +61,17 @@ def test_recursive(): assert os.system("remove-old-files.py --older 100 .") == 0 assert_files_exist(test3) assert_files_not_exist(test4) + + +def test_remove_empty_directory(): + create_files(['test3', 'test4'], 'subdir') + test3 = os.path.join('subdir', 'test3') + test4 = os.path.join('subdir', 'test4') + assert_files_exist([test3, test4]) + os.utime(test3, (0, 0)) + os.utime(test4, (0, 0)) + assert os.system("remove-old-files.py --older 100 .") == 0 + assert_files_exist('subdir') + assert_files_not_exist([test3, test4]) + assert os.system("remove-old-files.py -e --older 100 .") == 0 + assert_files_not_exist('subdir')