Added --cleanup, issue #262

This commit is contained in:
Rhet Turnbull
2020-12-05 21:22:49 -08:00
parent d371e63022
commit e5d6f21d8e
6 changed files with 386 additions and 213 deletions

View File

@@ -73,6 +73,18 @@ def test_unlink_file():
assert not os.path.isfile(dest)
def test_rmdir():
import os.path
import tempfile
from osxphotos.fileutil import FileUtil
temp_dir = tempfile.TemporaryDirectory(prefix="osxphotos_")
dir_name = temp_dir.name
assert os.path.isdir(dir_name)
FileUtil.rmdir(dir_name)
assert not os.path.isdir(dir_name)
@pytest.mark.skipif(
"OSXPHOTOS_TEST_CONVERT" not in os.environ,
reason="Skip if running in Github actions, no GPU.",
@@ -90,6 +102,7 @@ def test_convert_to_jpeg():
assert FileUtil.convert_to_jpeg(imgfile, outfile)
assert outfile.is_file()
@pytest.mark.skipif(
"OSXPHOTOS_TEST_CONVERT" not in os.environ,
reason="Skip if running in Github actions, no GPU.",