Added --incloud, --not-incloud, --not-missing, --cloudasset, --not-cloudasset to query options, #800 (#902)
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,7 @@
|
||||
<key>hostuuid</key>
|
||||
<string>8E774325-0506-5746-9991-6B8189271107</string>
|
||||
<key>pid</key>
|
||||
<integer>71121</integer>
|
||||
<integer>30127</integer>
|
||||
<key>processname</key>
|
||||
<string>photolibraryd</string>
|
||||
<key>uid</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,8 +3,8 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>FaceIDModelLastGenerationKey</key>
|
||||
<date>2023-01-01T02:43:05Z</date>
|
||||
<date>2023-01-02T03:34:15Z</date>
|
||||
<key>PetIDModelLastGenerationKey</key>
|
||||
<date>2023-01-01T02:43:05Z</date>
|
||||
<date>2023-01-02T03:34:15Z</date>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,41 +3,41 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PHAAssetRevGeocodeEnrichmentTask</key>
|
||||
<date>2023-01-01T12:29:29Z</date>
|
||||
<date>2023-01-02T14:19:49Z</date>
|
||||
<key>PHACachingCPAnalyticsPropertiesTask</key>
|
||||
<date>2023-01-01T03:07:18Z</date>
|
||||
<date>2023-01-02T03:32:26Z</date>
|
||||
<key>PHAContactClassificationTask</key>
|
||||
<date>2023-01-01T03:07:21Z</date>
|
||||
<key>PHAFeaturesUsageReportingTask</key>
|
||||
<date>2023-01-01T03:01:09Z</date>
|
||||
<date>2023-01-02T03:32:21Z</date>
|
||||
<key>PHAForcedHighlightEnrichmentTask</key>
|
||||
<date>2023-01-01T03:07:21Z</date>
|
||||
<key>PHAGraphConsistencyTask</key>
|
||||
<date>2023-01-01T12:29:29Z</date>
|
||||
<date>2023-01-02T14:19:49Z</date>
|
||||
<key>PHAGraphRebuildTask</key>
|
||||
<date>2023-01-01T03:07:09Z</date>
|
||||
<date>2023-01-02T03:32:25Z</date>
|
||||
<key>PHAHighlightCollectionEnrichmentTask</key>
|
||||
<date>2023-01-01T12:29:29Z</date>
|
||||
<date>2023-01-02T12:19:51Z</date>
|
||||
<key>PHAHighlightEnrichmentTask</key>
|
||||
<date>2023-01-01T12:29:29Z</date>
|
||||
<date>2023-01-02T12:19:51Z</date>
|
||||
<key>PHAMediaSampleReportingTask</key>
|
||||
<date>2023-01-01T03:07:18Z</date>
|
||||
<date>2023-01-02T03:32:26Z</date>
|
||||
<key>PHAMemoriesEnrichmentTask</key>
|
||||
<date>2023-01-01T09:30:30Z</date>
|
||||
<date>2023-01-02T08:20:22Z</date>
|
||||
<key>PHAMemoryElectionTask</key>
|
||||
<date>2023-01-01T09:30:28Z</date>
|
||||
<date>2023-01-02T08:20:19Z</date>
|
||||
<key>PHAPeopleSuggestionEnrichmentTask</key>
|
||||
<date>2023-01-01T03:07:09Z</date>
|
||||
<date>2023-01-02T03:32:25Z</date>
|
||||
<key>PHAPortraitDonationEnrichmentTask</key>
|
||||
<date>2023-01-01T03:07:18Z</date>
|
||||
<date>2023-01-02T03:32:26Z</date>
|
||||
<key>PHARevGeocodeSyndicationTask</key>
|
||||
<date>2023-01-01T03:07:10Z</date>
|
||||
<date>2023-01-02T03:32:25Z</date>
|
||||
<key>PHASearchEnrichmentTask</key>
|
||||
<date>2023-01-01T12:29:30Z</date>
|
||||
<date>2023-01-02T12:19:51Z</date>
|
||||
<key>PHASuggestionGenerationTask</key>
|
||||
<date>2023-01-01T09:30:30Z</date>
|
||||
<date>2023-01-02T08:20:21Z</date>
|
||||
<key>PHASyndicationTask</key>
|
||||
<date>2023-01-01T09:30:24Z</date>
|
||||
<date>2023-01-02T10:19:44Z</date>
|
||||
<key>PHAUserBehaviorEnrichmentTask</key>
|
||||
<date>2023-01-01T03:07:19Z</date>
|
||||
</dict>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PLDeferredCriticalMaintenanceTask</key>
|
||||
<date>2023-01-01T20:30:18Z</date>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -10,7 +10,7 @@
|
||||
<string>Female</string>
|
||||
</dict>
|
||||
<key>cpa_cache_lastCacheTime</key>
|
||||
<date>2023-01-01T03:07:18Z</date>
|
||||
<date>2023-01-02T03:32:26Z</date>
|
||||
<key>cpa_cache_librarySummary</key>
|
||||
<dict>
|
||||
<key>cpa_common_collectionCount</key>
|
||||
@@ -18,7 +18,7 @@
|
||||
<key>cpa_common_faceAnalysisProgress</key>
|
||||
<real>1</real>
|
||||
<key>cpa_common_fullAnalysisProgress</key>
|
||||
<real>0.82608695652173914</real>
|
||||
<real>0.95652173913043481</real>
|
||||
<key>cpa_common_icpl_enabled</key>
|
||||
<true/>
|
||||
<key>cpa_common_icpl_exceedingQuota</key>
|
||||
|
||||
@@ -79,6 +79,6 @@
|
||||
</array>
|
||||
</dict>
|
||||
<key>lastUpdate</key>
|
||||
<date>2023-01-01T14:28:52Z</date>
|
||||
<date>2023-01-07T21:16:51Z</date>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>cloudVersion</key>
|
||||
<string>6F1E8C70-E1EC-49EC-BEA4-232A98DEC784</string>
|
||||
<string>F02D1521-86FA-4519-8DF7-E4AFFC255EEE</string>
|
||||
<key>localVersionToken</key>
|
||||
<data>
|
||||
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
|
||||
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGnCwwRGRobIVUkbnVsbNINDg8Q
|
||||
ViRjbGFzc18QIk5TUGVyc2lzdGVudEhpc3RvcnlUb2tlbkRpY3Rpb25hcnmABoAC0xIT
|
||||
DRQWGFdOUy5rZXlzWk5TLm9iamVjdHOhFYADoReABIAFXxAkNjY0RDREMTgtNzQ2MS00
|
||||
MDlBLTgzNDUtMDI3NjgyQUVGNkFDEMHSHB0eH1okY2xhc3NuYW1lWCRjbGFzc2VzXE5T
|
||||
MDlBLTgzNDUtMDI3NjgyQUVGNkFDEMXSHB0eH1okY2xhc3NuYW1lWCRjbGFzc2VzXE5T
|
||||
RGljdGlvbmFyeaIeIFhOU09iamVjdNIcHSIjXxAZX05TUGVyc2lzdGVudEhpc3RvcnlU
|
||||
b2tlbqMkJSBfEBlfTlNQZXJzaXN0ZW50SGlzdG9yeVRva2VuXxAYTlNQZXJzaXN0ZW50
|
||||
SGlzdG9yeVRva2VuAAgAEQAaACQAKQAyADcASQBMAFEAUwBbAGEAZgBtAJIAlACWAJ0A
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -14,7 +14,7 @@
|
||||
<integer>6</integer>
|
||||
</dict>
|
||||
<key>cloudAssetCountPerTypeLastCheckDate</key>
|
||||
<date>2022-12-31T23:31:04Z</date>
|
||||
<date>2023-01-07T21:17:09Z</date>
|
||||
<key>hasBatteryBudgetKey</key>
|
||||
<true/>
|
||||
<key>hasCellularBudgetKey</key>
|
||||
@@ -26,8 +26,8 @@
|
||||
<key>initialSyncDate</key>
|
||||
<date>2022-12-31T23:31:08Z</date>
|
||||
<key>lastCompletePrefetchDate</key>
|
||||
<date>2023-01-01T15:28:36Z</date>
|
||||
<date>2023-01-07T21:17:00Z</date>
|
||||
<key>lastSyncDate</key>
|
||||
<date>2023-01-01T15:44:07Z</date>
|
||||
<date>2023-01-07T21:17:09Z</date>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 115 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 742 KiB |
Binary file not shown.
Binary file not shown.
@@ -2,6 +2,10 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>coalesceDate</key>
|
||||
<date>2023-01-01T20:30:19Z</date>
|
||||
<key>coalescePayloadVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>currentPayloadVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>snapshotDate</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -2,6 +2,10 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>coalesceDate</key>
|
||||
<date>2023-01-01T20:30:19Z</date>
|
||||
<key>coalescePayloadVersion</key>
|
||||
<integer>103</integer>
|
||||
<key>currentPayloadVersion</key>
|
||||
<integer>103</integer>
|
||||
<key>snapshotDate</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -2,6 +2,10 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>coalesceDate</key>
|
||||
<date>2023-01-01T20:30:19Z</date>
|
||||
<key>coalescePayloadVersion</key>
|
||||
<integer>2</integer>
|
||||
<key>currentPayloadVersion</key>
|
||||
<integer>2</integer>
|
||||
<key>snapshotDate</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -2,6 +2,10 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>coalesceDate</key>
|
||||
<date>2023-01-01T20:30:19Z</date>
|
||||
<key>coalescePayloadVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>currentPayloadVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>snapshotDate</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,6 +2,10 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>coalesceDate</key>
|
||||
<date>2023-01-01T20:30:19Z</date>
|
||||
<key>coalescePayloadVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>currentPayloadVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>snapshotDate</key>
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>coalesceDate</key>
|
||||
<date>2023-01-01T20:30:19Z</date>
|
||||
<key>coalescePayloadVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>currentPayloadVersion</key>
|
||||
<integer>1</integer>
|
||||
<key>snapshotDate</key>
|
||||
|
||||
Binary file not shown.
@@ -599,6 +599,7 @@ PHOTOS_NOT_IN_TRASH_LEN_15_7 = 27
|
||||
PHOTOS_IN_TRASH_LEN_15_7 = 2
|
||||
PHOTOS_MISSING_15_7 = 2
|
||||
PHOTOS_EDITED_15_7 = 6
|
||||
PHOTOS_NOT_MISSING_15_7 = PHOTOS_NOT_IN_TRASH_LEN_15_7 - PHOTOS_MISSING_15_7
|
||||
|
||||
CLI_PLACES_JSON = """{"places": {"_UNKNOWN_": 1, "Maui, Wailea, Hawai'i, United States": 1, "Washington, District of Columbia, United States": 1}}"""
|
||||
|
||||
@@ -5944,6 +5945,9 @@ def test_export_as_hardlink_download_missing():
|
||||
def test_export_missing():
|
||||
"""test export with --missing"""
|
||||
|
||||
# note this won't actually export the missing images since they are not in the test db
|
||||
# but it will test the code path by attempting to do the export
|
||||
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
@@ -5955,12 +5959,13 @@ def test_export_missing():
|
||||
".",
|
||||
"-V",
|
||||
"--missing",
|
||||
"--dry-run",
|
||||
"--download-missing",
|
||||
".",
|
||||
],
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "Exporting 2 photos" in result.output
|
||||
assert f"Exporting {PHOTOS_MISSING_15_7} photos" in result.output
|
||||
|
||||
|
||||
def test_export_missing_not_download_missing():
|
||||
@@ -5971,12 +5976,34 @@ def test_export_missing_not_download_missing():
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
export, [os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", "--missing", "."]
|
||||
export,
|
||||
[
|
||||
os.path.join(cwd, CLI_PHOTOS_DB),
|
||||
".",
|
||||
"-V",
|
||||
"--missing",
|
||||
"--dry-run",
|
||||
".",
|
||||
],
|
||||
)
|
||||
assert result.exit_code != 0
|
||||
assert "Incompatible export options" in result.output
|
||||
|
||||
|
||||
def test_export_not_missing():
|
||||
"""test export with --not-missing"""
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
export,
|
||||
[os.path.join(cwd, CLI_PHOTOS_DB), ".", "-V", "--not-missing", "--dry-run"],
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert f"Exporting {PHOTOS_NOT_MISSING_15_7} photos" in result.output
|
||||
|
||||
|
||||
def test_export_cleanup():
|
||||
"""test export with --cleanup flag"""
|
||||
|
||||
|
||||
86
tests/test_cli_export_cloud.py
Normal file
86
tests/test_cli_export_cloud.py
Normal file
@@ -0,0 +1,86 @@
|
||||
"""Test osxphotos export with cloud filters #800"""
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from click.testing import CliRunner
|
||||
|
||||
UUID_INCLOUD = "F73D96B2-24A6-40B2-B37C-5F82CF3F79E1" # IMG_0008.MOV
|
||||
UUID_NOT_INCLOUD = "C64A019E-7BB6-4A20-8540-686B5DF7BC1A" # 6E81F4CA-B7D9-4121-96E3-7667EFB7B310.JPG # shared images show as not in cloud
|
||||
UUID_CLOUDASSET = (
|
||||
"E214E862-9289-4769-B12B-BB5CC97929B3" # 7885e3f8-392e-44ea-b3b6-07ee97f0fea2.jpg
|
||||
)
|
||||
UUID_NOT_CLOUDASSET = "DC99FBDD-7A52-4100-A5BB-344131646C30" # St James Park.jpg
|
||||
|
||||
PHOTOS_DB_CLOUD = "tests/Test-Cloud-13.1.photoslibrary"
|
||||
PHOTOS_DB_NOT_CLOUD = "tests/Test-13.0.0.photoslibrary"
|
||||
|
||||
from osxphotos.cli import export
|
||||
|
||||
|
||||
def test_export_cloud_asset():
|
||||
"""test basic export with --cloudasset"""
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
export, [os.path.join(cwd, PHOTOS_DB_CLOUD), ".", "-V", "--cloudasset"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert UUID_CLOUDASSET in result.output
|
||||
|
||||
|
||||
def test_export_not_cloud_asset():
|
||||
"""test basic export with --not-cloudasset"""
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
export, [os.path.join(cwd, PHOTOS_DB_CLOUD), ".", "-V", "--not-cloudasset"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "Did not find any photos to export" in result.output
|
||||
|
||||
|
||||
def test_export_not_cloud_asset_2():
|
||||
"""test basic export with --not-cloudasset"""
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
export,
|
||||
[os.path.join(cwd, PHOTOS_DB_NOT_CLOUD), ".", "-V", "--not-cloudasset"],
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert UUID_NOT_CLOUDASSET in result.output
|
||||
|
||||
|
||||
def test_export_in_cloud():
|
||||
"""test basic export with --incloud"""
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
export, [os.path.join(cwd, PHOTOS_DB_CLOUD), ".", "-V", "--incloud"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert UUID_INCLOUD in result.output
|
||||
assert UUID_NOT_INCLOUD not in result.output
|
||||
|
||||
|
||||
def test_export_not_in_cloud():
|
||||
"""test basic export with --not-incloud"""
|
||||
runner = CliRunner()
|
||||
cwd = os.getcwd()
|
||||
# pylint: disable=not-context-manager
|
||||
with runner.isolated_filesystem():
|
||||
result = runner.invoke(
|
||||
export, [os.path.join(cwd, PHOTOS_DB_CLOUD), ".", "-V", "--not-incloud"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert UUID_INCLOUD not in result.output
|
||||
assert UUID_NOT_INCLOUD in result.output
|
||||
Reference in New Issue
Block a user