Updated test for Big Sur
This commit is contained in:
@@ -91,6 +91,19 @@ ALBUM_SORT_ORDER = [
|
||||
]
|
||||
ALBUM_KEY_PHOTO = "D79B8D77-BFFC-460B-9312-034F2877D35B"
|
||||
|
||||
UTI_DICT = {
|
||||
"8846E3E6-8AC8-4857-8448-E3D025784410": "public.tiff",
|
||||
"7783E8E6-9CAC-40F3-BE22-81FB7051C266": "public.heic",
|
||||
"1EB2B765-0765-43BA-A90C-0D0580E6172C": "public.jpeg",
|
||||
}
|
||||
|
||||
|
||||
UTI_ORIGINAL_DICT = {
|
||||
"8846E3E6-8AC8-4857-8448-E3D025784410": "public.tiff",
|
||||
"7783E8E6-9CAC-40F3-BE22-81FB7051C266": "public.heic",
|
||||
"1EB2B765-0765-43BA-A90C-0D0580E6172C": "public.jpeg",
|
||||
}
|
||||
|
||||
|
||||
def test_init1():
|
||||
# test named argument
|
||||
@@ -1046,11 +1059,13 @@ def test_from_to_date():
|
||||
|
||||
|
||||
def test_date_invalid():
|
||||
""" Test date is invalid """
|
||||
""" Test date is invalid """
|
||||
from datetime import datetime, timedelta, timezone
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
# UUID_DICT["date_invalid"] has an invalid date that's
|
||||
# been manually adjusted in the database
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["date_invalid"]])
|
||||
assert len(photos) == 1
|
||||
p = photos[0]
|
||||
@@ -1065,7 +1080,21 @@ def test_date_modified_invalid():
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
# UUID_DICT["date_invalid"] has an invalid modified date that's
|
||||
# been manually adjusted in the database
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["date_invalid"]])
|
||||
assert len(photos) == 1
|
||||
p = photos[0]
|
||||
assert p.date_modified is None
|
||||
|
||||
|
||||
def test_uti():
|
||||
""" test uti """
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
|
||||
for uuid, uti in UTI_DICT.items():
|
||||
photo = photosdb.get_photo(uuid)
|
||||
assert photo.uti == uti
|
||||
assert photo.uti_original == UTI_ORIGINAL_DICT[uuid]
|
||||
|
||||
Reference in New Issue
Block a user