Updated tests to run in GitHub actions
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
""" ImageConverter class
|
""" ImageConverter class
|
||||||
Convert an image to JPEG using CoreImage --
|
Convert an image to JPEG using CoreImage --
|
||||||
for example, RAW to JPEG """
|
for example, RAW to JPEG. Only works if Mac equipped with GPU. """
|
||||||
|
|
||||||
# reference: https://stackoverflow.com/questions/59330149/coreimage-ciimage-write-jpg-is-shifting-colors-macos/59334308#59334308
|
# reference: https://stackoverflow.com/questions/59330149/coreimage-ciimage-write-jpg-is-shifting-colors-macos/59334308#59334308
|
||||||
|
|
||||||
|
|||||||
@@ -840,6 +840,10 @@ def test_export_edited_suffix():
|
|||||||
assert sorted(files) == sorted(CLI_EXPORT_FILENAMES_EDITED_SUFFIX)
|
assert sorted(files) == sorted(CLI_EXPORT_FILENAMES_EDITED_SUFFIX)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
"OSXPHOTOS_TEST_CONVERT" not in os.environ,
|
||||||
|
reason="Skip if running in Github actions, no GPU.",
|
||||||
|
)
|
||||||
def test_export_convert_to_jpeg():
|
def test_export_convert_to_jpeg():
|
||||||
""" test --convert-to-jpeg """
|
""" test --convert-to-jpeg """
|
||||||
import glob
|
import glob
|
||||||
@@ -862,6 +866,10 @@ def test_export_convert_to_jpeg():
|
|||||||
assert large_file.stat().st_size > 10000000
|
assert large_file.stat().st_size > 10000000
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
"OSXPHOTOS_TEST_CONVERT" not in os.environ,
|
||||||
|
reason="Skip if running in Github actions, no GPU.",
|
||||||
|
)
|
||||||
def test_export_convert_to_jpeg_quality():
|
def test_export_convert_to_jpeg_quality():
|
||||||
""" test --convert-to-jpeg --jpeg-quality """
|
""" test --convert-to-jpeg --jpeg-quality """
|
||||||
import glob
|
import glob
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from osxphotos._constants import _UNKNOWN_PERSON
|
from osxphotos._constants import _UNKNOWN_PERSON
|
||||||
|
|
||||||
|
skip_test = "OSXPHOTOS_TEST_CONVERT" not in os.environ
|
||||||
|
pytestmark = pytest.mark.skipif(
|
||||||
|
skip_test, reason="Skip if running on GitHub actions, no GPU."
|
||||||
|
)
|
||||||
|
|
||||||
PHOTOS_DB = "tests/Test-10.15.6.photoslibrary"
|
PHOTOS_DB = "tests/Test-10.15.6.photoslibrary"
|
||||||
|
|
||||||
UUID_DICT = {
|
UUID_DICT = {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
""" test FileUtil """
|
""" test FileUtil """
|
||||||
|
|
||||||
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
TEST_HEIC = "tests/test-images/IMG_3092.heic"
|
TEST_HEIC = "tests/test-images/IMG_3092.heic"
|
||||||
@@ -72,6 +73,10 @@ def test_unlink_file():
|
|||||||
assert not os.path.isfile(dest)
|
assert not os.path.isfile(dest)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
"OSXPHOTOS_TEST_CONVERT" not in os.environ,
|
||||||
|
reason="Skip if running in Github actions, no GPU.",
|
||||||
|
)
|
||||||
def test_convert_to_jpeg():
|
def test_convert_to_jpeg():
|
||||||
""" test convert_to_jpeg """
|
""" test convert_to_jpeg """
|
||||||
import pathlib
|
import pathlib
|
||||||
@@ -85,7 +90,10 @@ def test_convert_to_jpeg():
|
|||||||
assert FileUtil.convert_to_jpeg(imgfile, outfile)
|
assert FileUtil.convert_to_jpeg(imgfile, outfile)
|
||||||
assert outfile.is_file()
|
assert outfile.is_file()
|
||||||
|
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
"OSXPHOTOS_TEST_CONVERT" not in os.environ,
|
||||||
|
reason="Skip if running in Github actions, no GPU.",
|
||||||
|
)
|
||||||
def test_convert_to_jpeg_quality():
|
def test_convert_to_jpeg_quality():
|
||||||
""" test convert_to_jpeg with compression_quality """
|
""" test convert_to_jpeg with compression_quality """
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|||||||
Reference in New Issue
Block a user