]> git.phdru.name Git - ppu.git/blobdiff - tests/test_remove_old_files.py
Remove empty directories
[ppu.git] / tests / test_remove_old_files.py
index e50b6fad711e5dbe2642b5b4c6f28c028da978d6..67da601952463f0c5379af8614b0b371aa7332f7 100755 (executable)
@@ -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')