Added date_modified to PhotoInfo
This commit is contained in:
@@ -455,8 +455,9 @@ def test_exiftool_json_sidecar():
|
||||
"GPSLongitude": "0 deg 7\' 54.50\\" W",
|
||||
"GPSPosition": "51 deg 30\' 12.86\\" N, 0 deg 7\' 54.50\\" W",
|
||||
"GPSLatitudeRef": "North", "GPSLongitudeRef": "West",
|
||||
"DateTimeOriginal": "2018:10:13 09:18:12", "OffsetTimeOriginal": "-04:00"}]
|
||||
"""
|
||||
"DateTimeOriginal": "2018:10:13 09:18:12",
|
||||
"OffsetTimeOriginal": "-04:00",
|
||||
"ModifyDate": "2019:12:08 14:06:44"}] """
|
||||
)
|
||||
|
||||
json_got = photos[0]._exiftool_json_sidecar()
|
||||
|
||||
@@ -397,7 +397,9 @@ def test_exiftool_json_sidecar():
|
||||
"GPSLongitude": "0 deg 7\' 54.50\\" W",
|
||||
"GPSPosition": "51 deg 30\' 12.86\\" N, 0 deg 7\' 54.50\\" W",
|
||||
"GPSLatitudeRef": "North", "GPSLongitudeRef": "West",
|
||||
"DateTimeOriginal": "2018:10:13 09:18:12", "OffsetTimeOriginal": "-04:00"}]
|
||||
"DateTimeOriginal": "2018:10:13 09:18:12",
|
||||
"OffsetTimeOriginal": "-04:00",
|
||||
"ModifyDate": "2019:12:01 11:43:45"}]
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
29
tests/test_modified_date_catalina_10_15_1.py
Normal file
29
tests/test_modified_date_catalina_10_15_1.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import pytest
|
||||
|
||||
PHOTOS_DB = "./tests/Test-Shared-10.15.1.photoslibrary/database/photos.db"
|
||||
PHOTOS_DB_PATH = "/Test-Shared-10.15.1.photoslibrary/database/photos.db"
|
||||
PHOTOS_LIBRARY_PATH = "/Test-Shared-10.15.1.photoslibrary"
|
||||
|
||||
UUID_DICT = {
|
||||
"modified": "37210110-E940-4227-92D3-45C40F68EB0A",
|
||||
"not_modified": "35243F7D-88C4-4408-B516-C74406E90C15",
|
||||
}
|
||||
|
||||
|
||||
def test_modified():
|
||||
import datetime
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["modified"]])
|
||||
assert photos[0].date_modified is not None
|
||||
assert photos[0].date_modified.isoformat() == "2019-12-26T21:08:48.306538-07:00"
|
||||
|
||||
|
||||
def test_not_modified():
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["not_modified"]])
|
||||
assert photos[0].date_modified is None
|
||||
|
||||
30
tests/test_modified_date_mojave_10_14_6.py
Normal file
30
tests/test_modified_date_mojave_10_14_6.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import pytest
|
||||
|
||||
PHOTOS_DB = "./tests/Test-10.14.6.photoslibrary/database/photos.db"
|
||||
PHOTOS_DB_PATH = "/Test-10.14.6.photoslibrary/database/photos.db"
|
||||
PHOTOS_LIBRARY_PATH = "/Test-Shared-10.14.6.photoslibrary"
|
||||
|
||||
UUID_DICT = {
|
||||
"modified": "3Jn73XpSQQCluzRBMWRsMA",
|
||||
"not_modified": "35243F7D-88C4-4408-B516-C74406E90C15",
|
||||
}
|
||||
|
||||
|
||||
def test_modified():
|
||||
import datetime
|
||||
import osxphotos
|
||||
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["modified"]])
|
||||
assert photos[0].date_modified is not None
|
||||
assert photos[0].date_modified.isoformat() == "2019-12-01T11:43:45.714123-04:00"
|
||||
|
||||
|
||||
# no non-modified photos in the 10.14.6 database
|
||||
# def test_not_modified():
|
||||
# import osxphotos
|
||||
|
||||
# photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
# photos = photosdb.photos(uuid=[UUID_DICT["not_modified"]])
|
||||
# assert photos[0].date_modified is None
|
||||
|
||||
Reference in New Issue
Block a user