From 6413342bdbd8b8331b871b6a847339c66b5e8cae Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Mon, 5 Oct 2020 06:16:35 -0700 Subject: [PATCH] Updated tests for Mojave --- .../database/photos.db | Bin 2052096 -> 2056192 bytes .../VisionService/PersonPromoter | 4 ++++ .../resources/moments/historicalmarker.plist | 2 +- .../resources/recovery/Info.plist | 2 +- .../recovery/RKSceneInVersion/0000000000.lij | Bin 18213 -> 19146 bytes .../recovery/RKVersion/0000000000.lij | Bin 170780 -> 172811 bytes .../RKVersionAnalysisState/0000000000.lij | Bin 18514 -> 18641 bytes tests/test_cli.py | 14 +++++++++----- tests/test_shared_mojave_10_14_6.py | 8 +++++--- 9 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tests/Test-10.14.6.photoslibrary/database/photos.db b/tests/Test-10.14.6.photoslibrary/database/photos.db index c01dda180cd84a87a1c1681370f731506cf589c3..4f1e44fd6629dd0f0530acb3de075857b8b604c7 100644 GIT binary patch delta 1247 zcmZ`(YfKzf6ux)fkKMVuu!XWaJ8ZyWTbG30J1A=^i=KN`Tcp-GX1#8hajF|EkM z(Z#0GrKG*lRUV1aN-M}iuc;=B`m1#{7}`i;XjA=RTB$`4TH2C$m#uC5;komjd-9!c z&dfb0Go6F&om1^$m)#8jTmg^FwcP6sK=;^z#x$O%?4^ls(n^GJ&){pY;q{^Z&`>|5 zU?^A$j)JEUC`1a0LZ(p2P`}!=n^9)5xS+Oq)G2jDeP2DHR;hl~qrRdxtD5paxv9)1 z)`b1DG9_SZ-~nVrg@3d3HiydS({1$$hW(Q=8G~`A?jbWq8F>(^_tnKM#kSyMw)T2l zhmye)|JJJgtt`PLk*o*mg=BX1ZhBwuQTG=%%W(wj$gAm=o>oIe7pV%ap!;YA{e|Yy z@90-Fhi1_X`Vn2EZRlsn)G3Q>bx_svPU;qe)Gbs}ce|X-4OosLxGPjYYN4>=`cdr@ z0&Uhy2!9{dQgn&q07~*PP)TNKv^j^dz=SajS&M3$EjSp{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(sz}c24#8@u^<}Ps5iW4}#1j5&!@I diff --git a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/PersonPromoter b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/PersonPromoter index fce0698d..4fdc85b4 100644 --- a/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/PersonPromoter +++ b/tests/Test-10.14.6.photoslibrary/private/com.apple.photoanalysisd/VisionService/PersonPromoter @@ -2,7 +2,11 @@ + ProcessedInQuiescentState + SuggestedMeIdentifier + Version + 3 diff --git a/tests/Test-10.14.6.photoslibrary/resources/moments/historicalmarker.plist b/tests/Test-10.14.6.photoslibrary/resources/moments/historicalmarker.plist index 64023c5a..cdcb374c 100644 --- a/tests/Test-10.14.6.photoslibrary/resources/moments/historicalmarker.plist +++ b/tests/Test-10.14.6.photoslibrary/resources/moments/historicalmarker.plist @@ -3,7 +3,7 @@ LastHistoryRowId - 943 + 947 LibraryBuildTag D8C4AAA1-3AB6-4A65-BEBD-99CC3E5D433E LibrarySchemaVersion diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/Info.plist b/tests/Test-10.14.6.photoslibrary/resources/recovery/Info.plist index 2a376de4..e71916e9 100644 --- a/tests/Test-10.14.6.photoslibrary/resources/recovery/Info.plist +++ b/tests/Test-10.14.6.photoslibrary/resources/recovery/Info.plist @@ -9,7 +9,7 @@ HistoricalMarker LastHistoryRowId - 943 + 947 LibraryBuildTag D8C4AAA1-3AB6-4A65-BEBD-99CC3E5D433E LibrarySchemaVersion diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKSceneInVersion/0000000000.lij index 5bd3033bb5d1945627e27c08964350193cf5a7ca..7df1ad0aa902f03f83e75297361d477941547f20 100644 GIT binary patch delta 176 zcmZ45$9QTg;|5jt$sY_e<=(S!E?{6_5MUGtS9Ux!wRqarzg2?F8wErJxCEIuOg5CC z2UMa2RT6=u#m2qhw;|5iC02Lbpu>b%7 diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersion/0000000000.lij index 34a51b3669630610ae7606779fbfdff6574821ec..53ec356a197a37976e6e1b773d287e8342026d20 100644 GIT binary patch delta 295 zcmbQUjjQ_@S3?Wq7ABe5lS^A9r(aNDs-NCv%OuFiwYjjTpSj+|+``1v+|5$g!ra_V z*Tl#e$TBrD(=~E7HZ(GJbai$ya#msh0s%&W4u64;B^*_3uUMp5<=7lqSFonAujle& z-^^;mHlO1=+g!G{?2O!R*}k#(u(NZEv0r8_VV}&loyCDUja85MU`c-q##RRU~+%$ug)o69IUoyUc#Q<^I_ j)X&kyD>OL7)g{O=T#$LQvg4tt#nW#TY?!{mg~<>AV@^!w delta 13 UcmeA^#x-XfS3?Wq7ABe504L@JDgXcg diff --git a/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij b/tests/Test-10.14.6.photoslibrary/resources/recovery/RKVersionAnalysisState/0000000000.lij index 2144feb39a0a40102c89b73ee790e7391fd2183d..557b6a8a2b908654441f92977ff7b8bdb8aba944 100644 GIT binary patch delta 28 kcmcaKf$`!*#tlIplTF-RxMY delta 9 QcmcaOk@3<5#tlIp02ZwT5dZ)H diff --git a/tests/test_cli.py b/tests/test_cli.py index 5c8854eb..e62c59de 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -257,7 +257,7 @@ CLI_TEMPLATE_SIDECAR_FILENAME = "Pumkins1.jpg.json" CLI_UUID_DICT_14_6 = {"intrash": "3tljdX43R8+k6peNHVrJNQ"} -PHOTOS_NOT_IN_TRASH_LEN_14_6 = 7 +PHOTOS_NOT_IN_TRASH_LEN_14_6 = 12 PHOTOS_IN_TRASH_LEN_14_6 = 1 PHOTOS_MISSING_14_6 = 1 @@ -265,6 +265,10 @@ PHOTOS_NOT_IN_TRASH_LEN_15_5 = 13 PHOTOS_IN_TRASH_LEN_15_5 = 2 PHOTOS_MISSING_15_5 = 2 +PHOTOS_NOT_IN_TRASH_LEN_15_6 = 14 +PHOTOS_IN_TRASH_LEN_15_6 = 2 +PHOTOS_MISSING_15_6 = 1 + CLI_PLACES_JSON = """{"places": {"_UNKNOWN_": 1, "Maui, Wailea, Hawai'i, United States": 1, "Washington, District of Columbia, United States": 1}}""" CLI_EXIFTOOL = { @@ -1419,11 +1423,11 @@ def test_query_deleted_2(): runner = CliRunner() cwd = os.getcwd() result = runner.invoke( - query, ["--json", "--db", os.path.join(cwd, PHOTOS_DB_14_6), "--deleted"] + query, ["--json", "--db", os.path.join(cwd, PHOTOS_DB_15_6), "--deleted"] ) assert result.exit_code == 0 json_got = json.loads(result.output) - assert len(json_got) == PHOTOS_NOT_IN_TRASH_LEN_14_6 + PHOTOS_IN_TRASH_LEN_14_6 + assert len(json_got) == PHOTOS_NOT_IN_TRASH_LEN_15_6 + PHOTOS_IN_TRASH_LEN_15_6 def test_query_deleted_3(): @@ -1456,11 +1460,11 @@ def test_query_deleted_4(): runner = CliRunner() cwd = os.getcwd() result = runner.invoke( - query, ["--json", "--db", os.path.join(cwd, PHOTOS_DB_14_6), "--deleted-only"] + query, ["--json", "--db", os.path.join(cwd, PHOTOS_DB_15_6), "--deleted-only"] ) assert result.exit_code == 0 json_got = json.loads(result.output) - assert len(json_got) == PHOTOS_IN_TRASH_LEN_14_6 + assert len(json_got) == PHOTOS_IN_TRASH_LEN_15_6 assert json_got[0]["intrash"] diff --git a/tests/test_shared_mojave_10_14_6.py b/tests/test_shared_mojave_10_14_6.py index b78e592b..3dbd0803 100644 --- a/tests/test_shared_mojave_10_14_6.py +++ b/tests/test_shared_mojave_10_14_6.py @@ -1,8 +1,6 @@ import pytest -# TODO: put some of this code into a pre-function - 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-10.14.6.photoslibrary" @@ -16,6 +14,10 @@ ALBUM_DICT = { } +PHOTOS_DB_LEN = 13 +PHOTOS_NOT_IN_TRASH_LEN = 12 +PHOTOS_IN_TRASH_LEN = 1 + def test_album_names(): import osxphotos @@ -69,4 +71,4 @@ def test_not_shared(): photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB) photos = [p for p in photosdb.photos() if not p.shared] - assert len(photos) == 7 + assert len(photos) == PHOTOS_NOT_IN_TRASH_LEN