From ae0166da049fc7831402cbe07ba9eb034afe6602 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sun, 4 Oct 2020 08:25:22 -0700 Subject: [PATCH] Added test for Big Sur path_edited --- tests/test_bigsur_10_16_0.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/test_bigsur_10_16_0.py b/tests/test_bigsur_10_16_0.py index b7dfb365..8a84d6a8 100644 --- a/tests/test_bigsur_10_16_0.py +++ b/tests/test_bigsur_10_16_0.py @@ -104,6 +104,12 @@ UTI_ORIGINAL_DICT = { "1EB2B765-0765-43BA-A90C-0D0580E6172C": "public.jpeg", } +# HEIC image that's been edited in Big Sur, resulting edit is .HEIC +UUID_HEIC_EDITED = "7783E8E6-9CAC-40F3-BE22-81FB7051C266" +PATH_HEIC_EDITED = ( + "resources/renders/7/7783E8E6-9CAC-40F3-BE22-81FB7051C266_1_201_a.heic" +) + def test_init1(): # test named argument @@ -442,7 +448,7 @@ def test_external_edit2(): assert p.external_edit == False -def test_path_edited1(): +def test_path_edited_jpeg(): # test a valid edited path import os.path import osxphotos @@ -458,6 +464,17 @@ def test_path_edited1(): assert os.path.exists(path) +def test_path_edited_heic(): + # test a valid edited path for .heic image + import pathlib + import osxphotos + + photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB) + photo = photosdb.get_photo(UUID_HEIC_EDITED) + assert photo.path_edited.endswith(PATH_HEIC_EDITED) + assert pathlib.Path(photo.path_edited).is_file() + + def test_path_edited2(): # test an invalid edited path import osxphotos