Partial fix for issue #247 on Mojave

This commit is contained in:
Rhet Turnbull
2020-10-31 21:04:44 -07:00
parent 13df6a2395
commit 6ac311199e
8 changed files with 62 additions and 16 deletions

View File

@@ -3,8 +3,8 @@
<plist version="1.0">
<dict>
<key>PhotoAnalysisGraphLastBackgroundGraphRebuildJobDate</key>
<date>2020-10-09T16:14:42Z</date>
<date>2020-11-01T02:34:49Z</date>
<key>PhotoAnalysisGraphLastBackgroundMemoryGenerationJobDate</key>
<date>2020-10-10T05:21:03Z</date>
<date>2020-11-01T02:34:49Z</date>
</dict>
</plist>

View File

@@ -11,6 +11,6 @@
<key>PLLastRevGeoForcedProviderOutOfDateCheckVersionKey</key>
<integer>1</integer>
<key>PLLastRevGeoVerFileFetchDateKey</key>
<date>2020-10-04T23:43:17Z</date>
<date>2020-11-01T02:34:46Z</date>
</dict>
</plist>

View File

@@ -24,7 +24,7 @@
<key>SnapshotCompletedDate</key>
<date>2019-07-27T13:16:43Z</date>
<key>SnapshotLastValidated</key>
<date>2020-10-10T05:22:36Z</date>
<date>2020-11-01T02:34:46Z</date>
<key>SnapshotTables</key>
<dict/>
</dict>

View File

@@ -1,6 +1,10 @@
""" Test basic methods for Mojave 10.14.6 """
import datetime
from collections import namedtuple
import pytest
from collections import namedtuple
from osxphotos._constants import _UNKNOWN_PERSON
PHOTOS_DB = "./tests/Test-10.14.6.photoslibrary/database/photos.db"
@@ -535,6 +539,31 @@ def test_date_modified_invalid(photosdb):
assert p.date_modified is None
def test_date_modified(photosdb):
""" Test date modified for photo that has been edited """
photos = photosdb.photos(uuid=[UUID_DICT["has_adjustments"]])
p = photos[0]
assert p.date_modified == datetime.datetime(
2019,
11,
27,
1,
30,
16,
681150,
tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000)),
)
def test_date_modified_none(photosdb):
""" Test date modified for a photo that hasn't been edited """
photos = photosdb.photos(uuid=[UUID_DICT["no_adjustments"]])
p = photos[0]
assert p.date_modified is None
def test_uti(photosdb):
for uuid, utis in UUID_UTI_DICT.items():
photo = photosdb.get_photo(uuid)