diff --git a/osxphotos/__init__.py b/osxphotos/__init__.py
index cfce7d95..603e0ea4 100644
--- a/osxphotos/__init__.py
+++ b/osxphotos/__init__.py
@@ -26,14 +26,15 @@ from . import _applescript
# TODO: fix versions tested to include 10.14.6
# which Photos library database versions have been tested
+# Photos 2.0 (10.12.6) == 2622
# Photos 3.0 (10.13.6) == 3301
# Photos 4.0 (10.14.5) == 4016
# Photos 4.0 (10.4.6) == 4025
# TODO: Should this also use compatibleBackToVersion from LiGlobals?
-_TESTED_DB_VERSIONS = ["4025", "4016", "3301"]
+_TESTED_DB_VERSIONS = ["4025", "4016", "3301", "2622"]
# which major version operating systems have been tested
-_TESTED_OS_VERSIONS = ["13", "14"]
+_TESTED_OS_VERSIONS = ["12", "13", "14"]
_debug = False
diff --git a/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins1.jpg b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins1.jpg
new file mode 100644
index 00000000..b1615930
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins1.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins2.jpg b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins2.jpg
new file mode 100644
index 00000000..f23a024a
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins2.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumpkins3.jpg b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumpkins3.jpg
new file mode 100644
index 00000000..136dfe8d
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumpkins3.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/St James Park.jpg b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/St James Park.jpg
new file mode 100644
index 00000000..e5a6b0bd
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/St James Park.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Tulips.jpg b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Tulips.jpg
new file mode 100644
index 00000000..31eb2ab3
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Tulips.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/wedding.jpg b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/wedding.jpg
new file mode 100644
index 00000000..ad8137e3
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/wedding.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/database/DataModelVersion.plist b/tests/Test-10.12.6.photoslibrary/database/DataModelVersion.plist
new file mode 100644
index 00000000..c3535a22
--- /dev/null
+++ b/tests/Test-10.12.6.photoslibrary/database/DataModelVersion.plist
@@ -0,0 +1,18 @@
+
+
+
+
+ DatabaseMinorVersion
+ 1
+ DatabaseVersion
+ 112
+ LastOpenMode
+ 2
+ LibrarySchemaVersion
+ 2622
+ MetaSchemaVersion
+ 2
+ createDate
+ 2019-08-24T02:50:48Z
+
+
diff --git a/tests/Test-10.12.6.photoslibrary/database/RKAlbum_name.skindex b/tests/Test-10.12.6.photoslibrary/database/RKAlbum_name.skindex
new file mode 100644
index 00000000..de8ab8c7
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/database/RKAlbum_name.skindex differ
diff --git a/tests/Test-10.12.6.photoslibrary/database/RKMemory_title.skindex b/tests/Test-10.12.6.photoslibrary/database/RKMemory_title.skindex
new file mode 100644
index 00000000..f6150b0e
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/database/RKMemory_title.skindex differ
diff --git a/tests/Test-10.12.6.photoslibrary/database/RKVersion_searchIndexText.skindex b/tests/Test-10.12.6.photoslibrary/database/RKVersion_searchIndexText.skindex
new file mode 100644
index 00000000..031167d3
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/database/RKVersion_searchIndexText.skindex differ
diff --git a/tests/Test-10.12.6.photoslibrary/database/metaSchema.db b/tests/Test-10.12.6.photoslibrary/database/metaSchema.db
new file mode 100644
index 00000000..a69a92eb
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/database/metaSchema.db differ
diff --git a/tests/Test-10.12.6.photoslibrary/database/photos.db b/tests/Test-10.12.6.photoslibrary/database/photos.db
new file mode 100644
index 00000000..3f05fbaf
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/database/photos.db differ
diff --git a/tests/Test-10.12.6.photoslibrary/database/photos.db-wal b/tests/Test-10.12.6.photoslibrary/database/photos.db-wal
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Test-10.12.6.photoslibrary/private/.metadata_never_index b/tests/Test-10.12.6.photoslibrary/private/.metadata_never_index
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.Photos/appPrivateData.plist b/tests/Test-10.12.6.photoslibrary/private/com.apple.Photos/appPrivateData.plist
new file mode 100644
index 00000000..f8d962c6
--- /dev/null
+++ b/tests/Test-10.12.6.photoslibrary/private/com.apple.Photos/appPrivateData.plist
@@ -0,0 +1,25 @@
+
+
+
+
+ LithiumMessageTracer
+
+ LastReportedDate
+ 2019-08-24T02:50:48Z
+
+ PXPeopleScreenUnlocked
+
+ Photos
+
+ IPXWorkspaceControllerPhotosHasContentKey
+
+ IPXWorkspaceControllerZoomLevelsKey
+
+ kZoomLevelIdentifierAlbums
+ 7
+ kZoomLevelIdentifierVersions
+ 7
+
+
+
+
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotoAnalysisServicePreferences.plist b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotoAnalysisServicePreferences.plist
new file mode 100644
index 00000000..82f8638a
--- /dev/null
+++ b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotoAnalysisServicePreferences.plist
@@ -0,0 +1,10 @@
+
+
+
+
+ PhotoAnalysisGraphLastBackgroundGraphRebuildJobDate
+ 2019-08-24T02:51:33Z
+ PhotoAnalysisGraphLastBackgroundMemoryGenerationJobDate
+ 2019-08-24T13:19:30Z
+
+
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/construction-photosgraph.graphdb b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/construction-photosgraph.graphdb
new file mode 100644
index 00000000..52393d2e
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/construction-photosgraph.graphdb differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/construction-photosgraph.graphdb-shm b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/construction-photosgraph.graphdb-shm
new file mode 100644
index 00000000..fe9ac284
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/construction-photosgraph.graphdb-shm differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/construction-photosgraph.graphdb-wal b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/construction-photosgraph.graphdb-wal
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/liveupdate-photosgraph.graphdb b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/liveupdate-photosgraph.graphdb
new file mode 100644
index 00000000..52393d2e
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/liveupdate-photosgraph.graphdb differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/liveupdate-photosgraph.graphdb-shm b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/liveupdate-photosgraph.graphdb-shm
new file mode 100644
index 00000000..fe9ac284
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/liveupdate-photosgraph.graphdb-shm differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/liveupdate-photosgraph.graphdb-wal b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/liveupdate-photosgraph.graphdb-wal
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph-tmp.graphdb b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph-tmp.graphdb
new file mode 100644
index 00000000..52393d2e
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph-tmp.graphdb differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph-tmp.graphdb-shm b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph-tmp.graphdb-shm
new file mode 100644
index 00000000..fe9ac284
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph-tmp.graphdb-shm differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph-tmp.graphdb-wal b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph-tmp.graphdb-wal
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb
new file mode 100644
index 00000000..323eccdc
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-shm b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-shm
new file mode 100644
index 00000000..fe9ac284
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-shm differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-wal b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/GraphService/PhotosGraph/photosgraph.graphdb-wal
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/A95B86EC-CAD1-4029-821D-C9223010D765.cmap b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/A95B86EC-CAD1-4029-821D-C9223010D765.cmap
new file mode 100644
index 00000000..311704e7
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/A95B86EC-CAD1-4029-821D-C9223010D765.cmap differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/AlgoFaceClusterCache.data b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/AlgoFaceClusterCache.data
new file mode 100644
index 00000000..6043015a
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/AlgoFaceClusterCache.data differ
diff --git a/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/D0EF1A90-2EAF-4736-A6EF-5CDDF970C1CC.cmap b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/D0EF1A90-2EAF-4736-A6EF-5CDDF970C1CC.cmap
new file mode 100644
index 00000000..1c9e89ca
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/D0EF1A90-2EAF-4736-A6EF-5CDDF970C1CC.cmap differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/.metadata_never_index b/tests/Test-10.12.6.photoslibrary/resources/.metadata_never_index
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_1.jpeg b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_1.jpeg
new file mode 100644
index 00000000..ead993d4
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_1.jpeg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_2.jpeg b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_2.jpeg
new file mode 100644
index 00000000..bced1de4
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_2.jpeg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_3.jpeg b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_3.jpeg
new file mode 100644
index 00000000..081e5805
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_3.jpeg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_4.jpeg b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_4.jpeg
new file mode 100644
index 00000000..58f9d332
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_4.jpeg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_5.jpeg b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_5.jpeg
new file mode 100644
index 00000000..59b04f8c
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_5.jpeg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_8.jpeg b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_8.jpeg
new file mode 100644
index 00000000..6897605b
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_8.jpeg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_9.jpeg b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_9.jpeg
new file mode 100644
index 00000000..e6667973
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/media/face/00/00/facetile_9.jpeg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/media/version/00/00/fullsizeoutput_7.jpeg b/tests/Test-10.12.6.photoslibrary/resources/media/version/00/00/fullsizeoutput_7.jpeg
new file mode 100644
index 00000000..71094d07
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/media/version/00/00/fullsizeoutput_7.jpeg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/moments/analysismetadata.plist b/tests/Test-10.12.6.photoslibrary/resources/moments/analysismetadata.plist
new file mode 100644
index 00000000..3a99d5f2
--- /dev/null
+++ b/tests/Test-10.12.6.photoslibrary/resources/moments/analysismetadata.plist
@@ -0,0 +1,16 @@
+
+
+
+
+ PLLanguageAndLocaleKey
+ en-US:en_US
+ PLLastGeoProviderIdKey
+ 7618
+ PLLastLocationInfoFormatVer
+ 12
+ PLLastRevGeoForcedProviderOutOfDateCheckVersionKey
+ 1
+ PLLastRevGeoVerFileFetchDateKey
+ 2019-08-24T02:51:30Z
+
+
diff --git a/tests/Test-10.12.6.photoslibrary/resources/moments/historicalmarker.plist b/tests/Test-10.12.6.photoslibrary/resources/moments/historicalmarker.plist
new file mode 100644
index 00000000..3036efd1
--- /dev/null
+++ b/tests/Test-10.12.6.photoslibrary/resources/moments/historicalmarker.plist
@@ -0,0 +1,12 @@
+
+
+
+
+ LastHistoryRowId
+ 414
+ LibraryBuildTag
+ E3E46F2A-7168-4973-AB3E-5848F80BFC7D
+ LibrarySchemaVersion
+ 2622
+
+
diff --git a/tests/Test-10.12.6.photoslibrary/resources/moments/needsanalysis b/tests/Test-10.12.6.photoslibrary/resources/moments/needsanalysis
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Test-10.12.6.photoslibrary/resources/moments/serverinfo.plist b/tests/Test-10.12.6.photoslibrary/resources/moments/serverinfo.plist
new file mode 100644
index 00000000..ce9edee3
--- /dev/null
+++ b/tests/Test-10.12.6.photoslibrary/resources/moments/serverinfo.plist
@@ -0,0 +1,47 @@
+
+
+
+
+ FileVersion
+ 11
+ Source
+
+ 35230
+
+ CountryMinVersions
+
+ OTHER
+ 1
+
+ CurrentVersion
+ 1
+ NoResultErrorIsSuccess
+
+
+ 57879
+
+ CountryMinVersions
+
+ OTHER
+ 1
+
+ CurrentVersion
+ 1
+ NoResultErrorIsSuccess
+
+
+ 7618
+
+ AddCountyIfNeeded
+
+ CountryMinVersions
+
+ OTHER
+ 10
+
+ CurrentVersion
+ 10
+
+
+
+
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/1/Ja1Ev1J%R%uM2anPTpm+Nw_mini_1.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/1/Ja1Ev1J%R%uM2anPTpm+Nw_mini_1.jpg
new file mode 100644
index 00000000..a50fc828
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/1/Ja1Ev1J%R%uM2anPTpm+Nw_mini_1.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/1/Ja1Ev1J%R%uM2anPTpm+Nw_thumb_1.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/1/Ja1Ev1J%R%uM2anPTpm+Nw_thumb_1.jpg
new file mode 100644
index 00000000..cbc15711
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/1/Ja1Ev1J%R%uM2anPTpm+Nw_thumb_1.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/2/UNADJUSTEDNONRAW_mini_2.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/2/UNADJUSTEDNONRAW_mini_2.jpg
new file mode 100644
index 00000000..db6c5159
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/2/UNADJUSTEDNONRAW_mini_2.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/2/UNADJUSTEDNONRAW_thumb_2.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/2/UNADJUSTEDNONRAW_thumb_2.jpg
new file mode 100644
index 00000000..ac25ae20
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/2/UNADJUSTEDNONRAW_thumb_2.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/3/UNADJUSTEDNONRAW_mini_3.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/3/UNADJUSTEDNONRAW_mini_3.jpg
new file mode 100644
index 00000000..31568a58
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/3/UNADJUSTEDNONRAW_mini_3.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/3/UNADJUSTEDNONRAW_thumb_3.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/3/UNADJUSTEDNONRAW_thumb_3.jpg
new file mode 100644
index 00000000..12c25523
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/3/UNADJUSTEDNONRAW_thumb_3.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/4/UNADJUSTEDNONRAW_mini_4.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/4/UNADJUSTEDNONRAW_mini_4.jpg
new file mode 100644
index 00000000..13f1dcfb
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/4/UNADJUSTEDNONRAW_mini_4.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/4/UNADJUSTEDNONRAW_thumb_4.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/4/UNADJUSTEDNONRAW_thumb_4.jpg
new file mode 100644
index 00000000..74bb7c73
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/4/UNADJUSTEDNONRAW_thumb_4.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/5/UNADJUSTEDNONRAW_mini_5.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/5/UNADJUSTEDNONRAW_mini_5.jpg
new file mode 100644
index 00000000..dd92dbc0
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/5/UNADJUSTEDNONRAW_mini_5.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/5/UNADJUSTEDNONRAW_thumb_5.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/5/UNADJUSTEDNONRAW_thumb_5.jpg
new file mode 100644
index 00000000..f9d92695
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/5/UNADJUSTEDNONRAW_thumb_5.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_mini_6.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_mini_6.jpg
new file mode 100644
index 00000000..5c0a3f8e
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_mini_6.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_thumb_6.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_thumb_6.jpg
new file mode 100644
index 00000000..76a8ab23
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/6/UNADJUSTEDNONRAW_thumb_6.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/7/UNADJUSTEDNONRAW_mini_7.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/7/UNADJUSTEDNONRAW_mini_7.jpg
new file mode 100644
index 00000000..630d969f
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/7/UNADJUSTEDNONRAW_mini_7.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/7/UNADJUSTEDNONRAW_thumb_7.jpg b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/7/UNADJUSTEDNONRAW_thumb_7.jpg
new file mode 100644
index 00000000..4a973998
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/proxies/derivatives/00/00/7/UNADJUSTEDNONRAW_thumb_7.jpg differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/Info.plist b/tests/Test-10.12.6.photoslibrary/resources/recovery/Info.plist
new file mode 100644
index 00000000..afe288ff
--- /dev/null
+++ b/tests/Test-10.12.6.photoslibrary/resources/recovery/Info.plist
@@ -0,0 +1,29 @@
+
+
+
+
+ DatabaseMinorVersion
+ 1
+ DatabaseVersion
+ 112
+ HistoricalMarker
+
+ LastHistoryRowId
+ 403
+ LibraryBuildTag
+ E3E46F2A-7168-4973-AB3E-5848F80BFC7D
+ LibrarySchemaVersion
+ 2622
+
+ LibrarySchemaVersion
+ 2622
+ MetaSchemaVersion
+ 2
+ SnapshotComplete
+
+ SnapshotCompletedDate
+ 2019-08-24T02:50:48Z
+ SnapshotTables
+
+
+
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAdjustmentData/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAdjustmentData/0000000000.lij
new file mode 100644
index 00000000..fd612c21
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAdjustmentData/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAdminData/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAdminData/0000000000.lij
new file mode 100644
index 00000000..a1d921e5
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAdminData/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAlbum/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAlbum/0000000000.lij
new file mode 100644
index 00000000..b300b69a
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAlbum/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAlbumVersion/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAlbumVersion/0000000000.lij
new file mode 100644
index 00000000..87f9c0a3
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKAlbumVersion/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKBookmark/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKBookmark/0000000000.lij
new file mode 100644
index 00000000..dda8bd1d
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKBookmark/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKCustomSortOrder/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKCustomSortOrder/0000000000.lij
new file mode 100644
index 00000000..cacedda8
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKCustomSortOrder/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFace/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFace/0000000000.lij
new file mode 100644
index 00000000..2b50fd74
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFace/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFaceGroup/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFaceGroup/0000000000.lij
new file mode 100644
index 00000000..aad77949
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFaceGroup/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFacePrint/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFacePrint/0000000000.lij
new file mode 100644
index 00000000..e963fbb2
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFacePrint/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFolder/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFolder/0000000000.lij
new file mode 100644
index 00000000..bfd31a20
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKFolder/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKImageProxyState/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKImageProxyState/0000000000.lij
new file mode 100644
index 00000000..8cc2d1ba
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKImageProxyState/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKImportGroup/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKImportGroup/0000000000.lij
new file mode 100644
index 00000000..5c8b7ec7
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKImportGroup/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKKeyword/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKKeyword/0000000000.lij
new file mode 100644
index 00000000..ecb15447
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKKeyword/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKKeywordForVersion/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKKeywordForVersion/0000000000.lij
new file mode 100644
index 00000000..bc0790d3
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKKeywordForVersion/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKMaster/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKMaster/0000000000.lij
new file mode 100644
index 00000000..8d36fff1
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKMaster/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKModelResource/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKModelResource/0000000000.lij
new file mode 100644
index 00000000..a4534def
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKModelResource/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPerson/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPerson/0000000000.lij
new file mode 100644
index 00000000..5c91e3ad
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPerson/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPlace/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPlace/0000000000.lij
new file mode 100644
index 00000000..6265ea48
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPlace/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPlaceForVersion/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPlaceForVersion/0000000000.lij
new file mode 100644
index 00000000..160a95ee
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKPlaceForVersion/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij
new file mode 100644
index 00000000..d22e06da
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij
new file mode 100644
index 00000000..e57ff789
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij
new file mode 100644
index 00000000..0b72e5f2
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVolume/0000000000.lij b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVolume/0000000000.lij
new file mode 100644
index 00000000..d7a35f28
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/recovery/RKVolume/0000000000.lij differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/segments/Thumb64Segment_0.data b/tests/Test-10.12.6.photoslibrary/resources/segments/Thumb64Segment_0.data
new file mode 100644
index 00000000..b35e111a
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/segments/Thumb64Segment_0.data differ
diff --git a/tests/Test-10.12.6.photoslibrary/resources/segments/ThumbJPGSegment_0.data b/tests/Test-10.12.6.photoslibrary/resources/segments/ThumbJPGSegment_0.data
new file mode 100644
index 00000000..e922778a
Binary files /dev/null and b/tests/Test-10.12.6.photoslibrary/resources/segments/ThumbJPGSegment_0.data differ
diff --git a/tests/test_10_12_6.py b/tests/test_10_12_6.py
new file mode 100644
index 00000000..13c32157
--- /dev/null
+++ b/tests/test_10_12_6.py
@@ -0,0 +1,203 @@
+import pytest
+
+# TODO: put some of this code into a pre-function
+# TODO: All the hardocded uuids, etc in test functions should be in some sort of config
+
+PHOTOS_DB = "./tests/Test-10.12.6.photoslibrary/database/photos.db"
+KEYWORDS = [
+ "Kids",
+ "wedding",
+ "flowers",
+ "England",
+ "London",
+ "London 2018",
+ "St. James's Park",
+ "UK",
+ "United Kingdom",
+]
+PERSONS = ["Katie", "Suzy", "Maria"]
+ALBUMS = ["Pumpkin Farm", "Last Import"]
+KEYWORDS_DICT = {
+ "Kids": 4,
+ "wedding": 2,
+ "flowers": 1,
+ "England": 1,
+ "London": 1,
+ "London 2018": 1,
+ "St. James's Park": 1,
+ "UK": 1,
+ "United Kingdom": 1,
+}
+PERSONS_DICT = {"Katie": 3, "Suzy": 2, "Maria": 1}
+ALBUM_DICT = {"Pumpkin Farm": 3, "Last Import": 1}
+
+
+def test_init():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ assert isinstance(photosdb, osxphotos.PhotosDB)
+
+
+def test_db_version():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ assert photosdb.get_db_version() in osxphotos._TESTED_DB_VERSIONS
+
+
+def test_os_version():
+ import osxphotos
+
+ (_, major, _) = osxphotos._get_os_version()
+ assert major in osxphotos._TESTED_OS_VERSIONS
+
+
+def test_persons():
+ import osxphotos
+ import collections
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ assert "Katie" in photosdb.persons()
+ assert collections.Counter(PERSONS) == collections.Counter(photosdb.persons())
+
+
+def test_keywords():
+ import osxphotos
+ import collections
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ assert "wedding" in photosdb.keywords()
+ assert collections.Counter(KEYWORDS) == collections.Counter(photosdb.keywords())
+
+
+def test_albums():
+ import osxphotos
+ import collections
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ assert "Pumpkin Farm" in photosdb.albums()
+ assert collections.Counter(ALBUMS) == collections.Counter(photosdb.albums())
+
+
+def test_keywords_dict():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ keywords = photosdb.keywords_as_dict()
+ assert keywords["wedding"] == 2
+ assert keywords == KEYWORDS_DICT
+
+
+def test_persons_as_dict():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ persons = photosdb.persons_as_dict()
+ assert persons["Maria"] == 1
+ assert persons == PERSONS_DICT
+
+
+def test_albums_as_dict():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ albums = photosdb.albums_as_dict()
+ assert albums["Pumpkin Farm"] == 3
+ assert albums == ALBUM_DICT
+
+
+def test_attributes():
+ import datetime
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ photos = photosdb.photos(uuid=["sE5LlfekS8ykEE7o0cuMVA"])
+ assert len(photos) == 1
+ p = photos[0]
+ assert p.keywords() == ["Kids"]
+ assert p.filename() == "Pumkins2.jpg"
+ assert p.date() == datetime.datetime(2018, 9, 28, 16, 7, 7,0,datetime.timezone(datetime.timedelta(seconds=-14400)))
+ assert p.description() == "Girl holding pumpkin"
+ assert p.name() == "I found one!"
+ assert p.albums() == ["Pumpkin Farm"]
+ assert p.persons() == ["Katie"]
+ assert (
+ p.path()
+ == "./tests/Test-10.12.6.photoslibrary/Masters/2019/08/24/20190824-030824/Pumkins2.jpg"
+ )
+ assert p.ismissing() == False
+
+
+def test_missing():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ photos = photosdb.photos(uuid=["Pj99JmYjQkeezdY2OFuSaw"])
+ assert len(photos) == 1
+ p = photos[0]
+ assert p.path() == None
+ assert p.ismissing() == True
+
+
+def test_count():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ photos = photosdb.photos()
+ assert len(photos) == 7
+
+
+def test_keyword_2():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+ photos = photosdb.photos(keywords=["wedding"])
+ assert len(photos) == 2
+
+
+def test_keyword_not_in_album():
+ import osxphotos
+
+ photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+
+ # find all photos with keyword "Kids" not in the album "Pumpkin Farm"
+ photos1 = photosdb.photos(albums=["Pumpkin Farm"])
+ photos2 = photosdb.photos(keywords=["Kids"])
+ photos3 = [p for p in photos2 if p not in photos1]
+ assert len(photos3) == 1
+ assert photos3[0].uuid() == "Pj99JmYjQkeezdY2OFuSaw"
+
+
+# def main():
+# photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
+# print(photosdb.keywords())
+# print(photosdb.persons())
+# print(photosdb.albums())
+
+# print(photosdb.keywords_as_dict())
+# print(photosdb.persons_as_dict())
+# print(photosdb.albums_as_dict())
+
+# # # find all photos with Keyword = Foo and containing John Smith
+# # photos = photosdb.photos(keywords=["Foo"],persons=["John Smith"])
+# #
+# # # find all photos that include Alice Smith but do not contain the keyword Bar
+# # photos = [p for p in photosdb.photos(persons=["Alice Smith"])
+# # if p not in photosdb.photos(keywords=["Bar"]) ]
+# photos = photosdb.photos()
+# for p in photos:
+# print(
+# p.uuid(),
+# p.filename(),
+# p.date(),
+# p.description(),
+# p.name(),
+# p.keywords(),
+# p.albums(),
+# p.persons(),
+# p.path(),
+# )
+
+# if __name__ == "__main__":
+# main()