Repository: mandarons/icloud-drive-docker (python)

Issue:
[FEATURE] Downloads photos while maintaining photo albums
**Use case**
I want to backup all photos but also preserve albums structure.

**Describe the solution you'd like**
When not providing filter and providing extra flag docker should backup photos not to `all` folder but according to album structure.
It would be nice if docker would support nested albums as nested folders. Otherwise it can create flat folder structure replacing `/` with `-`, eg. `Folder-Subfolder/[photos inside]` instead of `Folder/Subfolder/[photos inside]`.

**Describe alternatives you've considered**
I do not see any :(

**Additional context**
Photo albums are available as filters so it should be doable.
Maybe if providing filter as `*` it should copy all?

eg. 

```
if filters["albums"]:
    if filters["albums"] == ["*"]:
        for album in photos.albums:
            sync_album(
                album=photos.albums[album],
                destination_path=os.path.join(destination_path, album),
                file_sizes=filters["file_sizes"],
            )
    else:
       old code path
```


Pull request:
Download photos from nested albums
Fixes #99

Patch:
diff --git a/.dockerignore b/.dockerignore
index 4fcd127a..989a47fc 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -12,4 +12,6 @@ Dockerfile
 allure-report
 pytest.ini
 run-tests.sh
-requirements-test.txt
\ No newline at end of file
+requirements-test.txt
+session
+session_data
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 1f12f805..cf531192 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,4 +134,5 @@ allure-results
 allure-report
 .history
 ignore-config.yaml
-session
\ No newline at end of file
+session
+session_data
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 00000000..c9a087a5
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,20 @@
+{
+  // Use IntelliSense to learn about possible attributes.
+  // Hover to view descriptions of existing attributes.
+  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+  "version": "0.2.0",
+  "configurations": [
+    {
+      "name": "Python: main.py",
+      "type": "python",
+      "request": "launch",
+      "program": "./src/main.py",
+      "console": "integratedTerminal",
+      "justMyCode": false,
+      "cwd": "${workspaceFolder}",
+      "env": {
+        "PYTHONPATH": "${workspaceFolder}"
+      }
+    }
+  ]
+}
diff --git a/src/sync_photos.py b/src/sync_photos.py
index 104bd552..f3740d74 100644
--- a/src/sync_photos.py
+++ b/src/sync_photos.py
@@ -89,7 +89,7 @@ def process_photo(photo, file_size, destination_path):
 
 def sync_album(album, destination_path, file_sizes, extensions=None):
     """Sync given album."""
-    if not (album and destination_path and file_sizes):
+    if album is None or destination_path is None or file_sizes is None:
         return None
     os.makedirs(destination_path, exist_ok=True)
     for photo in album:
@@ -98,6 +98,13 @@ def sync_album(album, destination_path, file_sizes, extensions=None):
                 process_photo(photo, file_size, destination_path)
         else:
             LOGGER.debug(f"Skipping the unwanted photo {photo.filename}.")
+    for subalbum in album.subalbums:
+        sync_album(
+            album.subalbums[subalbum],
+            os.path.join(destination_path, subalbum),
+            file_sizes,
+            extensions,
+        )
     return True
 
 


Test patch:
diff --git a/tests/data/__init__.py b/tests/data/__init__.py
index caf374b7..4ecf6b1f 100644
--- a/tests/data/__init__.py
+++ b/tests/data/__init__.py
@@ -3786,6 +3786,48 @@ class ICloudPySessionMock(base.ICloudPySession):
                         ][0]["response"]
                     )
                 if data.get("query").get("recordType") == "CPLAlbumByPositionLive":
+                    if (
+                        "filterBy" in data["query"]
+                        and data.get("query").get("filterBy")[0]["fieldValue"]["value"]
+                        == "E4RT4FB7-4A35-4958-1D42-5769E66BE407"
+                    ):
+                        return ResponseMock(
+                            photos_data.DATA[
+                                "query?remapEnums=True&getCurrentSyncToken=True"
+                            ][4]["response"]
+                        )
+
+                    if (
+                        "filterBy" in data["query"]
+                        and data.get("query").get("filterBy")[0]["fieldValue"]["value"]
+                        == "CB3DB78F-D683-42D5-A340-A5DECC7397F6"
+                    ):
+                        return ResponseMock(
+                            photos_data.DATA[
+                                "query?remapEnums=True&getCurrentSyncToken=True"
+                            ][5]["response"]
+                        )
+                    if (
+                        "filterBy" in data["query"]
+                        and data.get("query").get("filterBy")[0]["fieldValue"]["value"]
+                        == "E803E065-D8A4-4398-DE23-23F8FD0886EB"
+                    ):
+                        return ResponseMock(
+                            photos_data.DATA[
+                                "query?remapEnums=True&getCurrentSyncToken=True"
+                            ][6]["response"]
+                        )
+                    if (
+                        "filterBy" in data["query"]
+                        and data.get("query").get("filterBy")[0]["fieldValue"]["value"]
+                        == "E803E065-D8A4-4398-DE23-23F8FD0886EC"
+                    ):
+                        return ResponseMock(
+                            photos_data.DATA[
+                                "query?remapEnums=True&getCurrentSyncToken=True"
+                            ][7]["response"]
+                        )
+
                     return ResponseMock(
                         photos_data.DATA[
                             "query?remapEnums=True&getCurrentSyncToken=True"
diff --git a/tests/data/photos_data.py b/tests/data/photos_data.py
index eea05db2..5f51a34a 100644
--- a/tests/data/photos_data.py
+++ b/tests/data/photos_data.py
@@ -1607,6 +1607,575 @@ DATA = {
                 "syncToken": "AQAAAAAAArKjf//////////fSxWSKv5JfZ34edrt875d",
             },
         },
+        {
+            "data": {
+                "query": {
+                    "filterBy": [
+                        {
+                            "fieldName": "startRank",
+                            "fieldValue": {"type": "INT64", "value": 5},
+                            "comparator": "EQUALS",
+                        },
+                        {
+                            "fieldName": "direction",
+                            "fieldValue": {"type": "STRING", "value": "ASCENDING"},
+                            "comparator": "EQUALS",
+                        },
+                        {
+                            "fieldName": "parentId",
+                            "comparator": "EQUALS",
+                            "fieldValue": {
+                                "type": "STRING",
+                                "value": "E4RT4FB7-4A35-4958-1D42-5769E66BE407",
+                            },
+                        },
+                    ],
+                    "recordType": "CPLContainerRelationLiveByAssetDate",
+                },
+                "resultsLimit": 200,
+                "desiredKeys": [
+                    "resJPEGFullWidth",
+                    "resJPEGFullHeight",
+                    "resJPEGFullFileType",
+                    "resJPEGFullFingerprint",
+                    "resJPEGFullRes",
+                    "resJPEGLargeWidth",
+                    "resJPEGLargeHeight",
+                    "resJPEGLargeFileType",
+                    "resJPEGLargeFingerprint",
+                    "resJPEGLargeRes",
+                    "resJPEGMedWidth",
+                    "resJPEGMedHeight",
+                    "resJPEGMedFileType",
+                    "resJPEGMedFingerprint",
+                    "resJPEGMedRes",
+                    "resJPEGThumbWidth",
+                    "resJPEGThumbHeight",
+                    "resJPEGThumbFileType",
+                    "resJPEGThumbFingerprint",
+                    "resJPEGThumbRes",
+                    "resVidFullWidth",
+                    "resVidFullHeight",
+                    "resVidFullFileType",
+                    "resVidFullFingerprint",
+                    "resVidFullRes",
+                    "resVidMedWidth",
+                    "resVidMedHeight",
+                    "resVidMedFileType",
+                    "resVidMedFingerprint",
+                    "resVidMedRes",
+                    "resVidSmallWidth",
+                    "resVidSmallHeight",
+                    "resVidSmallFileType",
+                    "resVidSmallFingerprint",
+                    "resVidSmallRes",
+                    "resSidecarWidth",
+                    "resSidecarHeight",
+                    "resSidecarFileType",
+                    "resSidecarFingerprint",
+                    "resSidecarRes",
+                    "itemType",
+                    "dataClassType",
+                    "filenameEnc",
+                    "originalOrientation",
+                    "resOriginalWidth",
+                    "resOriginalHeight",
+                    "resOriginalFileType",
+                    "resOriginalFingerprint",
+                    "resOriginalRes",
+                    "resOriginalAltWidth",
+                    "resOriginalAltHeight",
+                    "resOriginalAltFileType",
+                    "resOriginalAltFingerprint",
+                    "resOriginalAltRes",
+                    "resOriginalVidComplWidth",
+                    "resOriginalVidComplHeight",
+                    "resOriginalVidComplFileType",
+                    "resOriginalVidComplFingerprint",
+                    "resOriginalVidComplRes",
+                    "isDeleted",
+                    "isExpunged",
+                    "dateExpunged",
+                    "remappedRef",
+                    "recordName",
+                    "recordType",
+                    "recordChangeTag",
+                    "masterRef",
+                    "adjustmentRenderType",
+                    "assetDate",
+                    "addedDate",
+                    "isFavorite",
+                    "isHidden",
+                    "orientation",
+                    "duration",
+                    "assetSubtype",
+                    "assetSubtypeV2",
+                    "assetHDRType",
+                    "burstFlags",
+                    "burstFlagsExt",
+                    "burstId",
+                    "captionEnc",
+                    "locationEnc",
+                    "locationV2Enc",
+                    "locationLatitude",
+                    "locationLongitude",
+                    "adjustmentType",
+                    "timeZoneOffset",
+                    "vidComplDurValue",
+                    "vidComplDurScale",
+                    "vidComplDispValue",
+                    "vidComplDispScale",
+                    "vidComplVisibilityState",
+                    "customRenderedValue",
+                    "containerId",
+                    "itemId",
+                    "position",
+                    "isKeyAsset",
+                ],
+                "zoneID": {"zoneName": "PrimarySync"},
+            },
+            "response": {
+                "records": [
+                    {
+                        "recordName": "CB3DB78F-D683-42D5-A340-A5DECC7397F6",
+                        "recordType": "CPLAlbum",
+                        "fields": {
+                            "recordModificationDate": {
+                                "value": 1552689229125,
+                                "type": "TIMESTAMP",
+                            },
+                            "sortAscending": {"value": 1, "type": "INT64"},
+                            "sortType": {"value": 1, "type": "INT64"},
+                            "albumType": {"value": 0, "type": "INT64"},
+                            "albumNameEnc": {
+                                "value": "YWxidW0tMS0x",
+                                "type": "ENCRYPTED_BYTES",
+                            },
+                            "position": {"value": 1024, "type": "INT64"},
+                            "sortTypeExt": {"value": 0, "type": "INT64"},
+                            "parentId": {
+                                "value": "E4RT4FB7-4A35-4958-1D42-5769E66BE407",
+                                "type": "STRING",
+                            },
+                        },
+                        "pluginFields": {},
+                        "recordChangeTag": "s1",
+                        "created": {
+                            "timestamp": 1552690148027,
+                            "userRecordName": "_8d63df18e352d448ea548f1f27c21668",
+                            "deviceID": "47BE16758BD3998F453FEBCAD786AD7CCE88372ECB48D2DCB0EB397D45A43F5F",
+                        },
+                        "modified": {
+                            "timestamp": 1552690148027,
+                            "userRecordName": "_8d63df18e352d448ea548f1f27c21668",
+                            "deviceID": "47BE16758BD3998F453FEBCAD786AD7CCE88372ECB48D2DCB0EB397D45A43F5F",
+                        },
+                        "deleted": False,
+                        "zoneID": {
+                            "zoneName": "PrimarySync",
+                            "ownerRecordName": "_8d63df18e352d448ea548f1f27c21668",
+                            "zoneType": "REGULAR_CUSTOM_ZONE",
+                        },
+                    },
+                ]
+            },
+        },
+        {
+            "data": {
+                "query": {
+                    "filterBy": [
+                        {
+                            "fieldName": "startRank",
+                            "fieldValue": {"type": "INT64", "value": 5},
+                            "comparator": "EQUALS",
+                        },
+                        {
+                            "fieldName": "direction",
+                            "fieldValue": {"type": "STRING", "value": "ASCENDING"},
+                            "comparator": "EQUALS",
+                        },
+                        {
+                            "fieldName": "parentId",
+                            "comparator": "EQUALS",
+                            "fieldValue": {
+                                "type": "STRING",
+                                "value": "CB3DB78F-D683-42D5-A340-A5DECC7397F6",
+                            },
+                        },
+                    ],
+                    "recordType": "CPLContainerRelationLiveByAssetDate",
+                },
+                "resultsLimit": 200,
+                "desiredKeys": [
+                    "resJPEGFullWidth",
+                    "resJPEGFullHeight",
+                    "resJPEGFullFileType",
+                    "resJPEGFullFingerprint",
+                    "resJPEGFullRes",
+                    "resJPEGLargeWidth",
+                    "resJPEGLargeHeight",
+                    "resJPEGLargeFileType",
+                    "resJPEGLargeFingerprint",
+                    "resJPEGLargeRes",
+                    "resJPEGMedWidth",
+                    "resJPEGMedHeight",
+                    "resJPEGMedFileType",
+                    "resJPEGMedFingerprint",
+                    "resJPEGMedRes",
+                    "resJPEGThumbWidth",
+                    "resJPEGThumbHeight",
+                    "resJPEGThumbFileType",
+                    "resJPEGThumbFingerprint",
+                    "resJPEGThumbRes",
+                    "resVidFullWidth",
+                    "resVidFullHeight",
+                    "resVidFullFileType",
+                    "resVidFullFingerprint",
+                    "resVidFullRes",
+                    "resVidMedWidth",
+                    "resVidMedHeight",
+                    "resVidMedFileType",
+                    "resVidMedFingerprint",
+                    "resVidMedRes",
+                    "resVidSmallWidth",
+                    "resVidSmallHeight",
+                    "resVidSmallFileType",
+                    "resVidSmallFingerprint",
+                    "resVidSmallRes",
+                    "resSidecarWidth",
+                    "resSidecarHeight",
+                    "resSidecarFileType",
+                    "resSidecarFingerprint",
+                    "resSidecarRes",
+                    "itemType",
+                    "dataClassType",
+                    "filenameEnc",
+                    "originalOrientation",
+                    "resOriginalWidth",
+                    "resOriginalHeight",
+                    "resOriginalFileType",
+                    "resOriginalFingerprint",
+                    "resOriginalRes",
+                    "resOriginalAltWidth",
+                    "resOriginalAltHeight",
+                    "resOriginalAltFileType",
+                    "resOriginalAltFingerprint",
+                    "resOriginalAltRes",
+                    "resOriginalVidComplWidth",
+                    "resOriginalVidComplHeight",
+                    "resOriginalVidComplFileType",
+                    "resOriginalVidComplFingerprint",
+                    "resOriginalVidComplRes",
+                    "isDeleted",
+                    "isExpunged",
+                    "dateExpunged",
+                    "remappedRef",
+                    "recordName",
+                    "recordType",
+                    "recordChangeTag",
+                    "masterRef",
+                    "adjustmentRenderType",
+                    "assetDate",
+                    "addedDate",
+                    "isFavorite",
+                    "isHidden",
+                    "orientation",
+                    "duration",
+                    "assetSubtype",
+                    "assetSubtypeV2",
+                    "assetHDRType",
+                    "burstFlags",
+                    "burstFlagsExt",
+                    "burstId",
+                    "captionEnc",
+                    "locationEnc",
+                    "locationV2Enc",
+                    "locationLatitude",
+                    "locationLongitude",
+                    "adjustmentType",
+                    "timeZoneOffset",
+                    "vidComplDurValue",
+                    "vidComplDurScale",
+                    "vidComplDispValue",
+                    "vidComplDispScale",
+                    "vidComplVisibilityState",
+                    "customRenderedValue",
+                    "containerId",
+                    "itemId",
+                    "position",
+                    "isKeyAsset",
+                ],
+                "zoneID": {"zoneName": "PrimarySync"},
+            },
+            "response": {
+                "records": [],
+                "syncToken": "AQAAAAAAArKjf//////////fSxWSKv5JfZ34edrt875d",
+            },
+        },
+        {
+            "data": {
+                "query": {
+                    "filterBy": [
+                        {
+                            "fieldName": "startRank",
+                            "fieldValue": {"type": "INT64", "value": 5},
+                            "comparator": "EQUALS",
+                        },
+                        {
+                            "fieldName": "direction",
+                            "fieldValue": {"type": "STRING", "value": "ASCENDING"},
+                            "comparator": "EQUALS",
+                        },
+                        {
+                            "fieldName": "parentId",
+                            "comparator": "EQUALS",
+                            "fieldValue": {
+                                "type": "STRING",
+                                "value": "E803E065-D8A4-4398-DE23-23F8FD0886EB",
+                            },
+                        },
+                    ],
+                    "recordType": "CPLContainerRelationLiveByAssetDate",
+                },
+                "resultsLimit": 200,
+                "desiredKeys": [
+                    "resJPEGFullWidth",
+                    "resJPEGFullHeight",
+                    "resJPEGFullFileType",
+                    "resJPEGFullFingerprint",
+                    "resJPEGFullRes",
+                    "resJPEGLargeWidth",
+                    "resJPEGLargeHeight",
+                    "resJPEGLargeFileType",
+                    "resJPEGLargeFingerprint",
+                    "resJPEGLargeRes",
+                    "resJPEGMedWidth",
+                    "resJPEGMedHeight",
+                    "resJPEGMedFileType",
+                    "resJPEGMedFingerprint",
+                    "resJPEGMedRes",
+                    "resJPEGThumbWidth",
+                    "resJPEGThumbHeight",
+                    "resJPEGThumbFileType",
+                    "resJPEGThumbFingerprint",
+                    "resJPEGThumbRes",
+                    "resVidFullWidth",
+                    "resVidFullHeight",
+                    "resVidFullFileType",
+                    "resVidFullFingerprint",
+                    "resVidFullRes",
+                    "resVidMedWidth",
+                    "resVidMedHeight",
+                    "resVidMedFileType",
+                    "resVidMedFingerprint",
+                    "resVidMedRes",
+                    "resVidSmallWidth",
+                    "resVidSmallHeight",
+                    "resVidSmallFileType",
+                    "resVidSmallFingerprint",
+                    "resVidSmallRes",
+                    "resSidecarWidth",
+                    "resSidecarHeight",
+                    "resSidecarFileType",
+                    "resSidecarFingerprint",
+                    "resSidecarRes",
+                    "itemType",
+                    "dataClassType",
+                    "filenameEnc",
+                    "originalOrientation",
+                    "resOriginalWidth",
+                    "resOriginalHeight",
+                    "resOriginalFileType",
+                    "resOriginalFingerprint",
+                    "resOriginalRes",
+                    "resOriginalAltWidth",
+                    "resOriginalAltHeight",
+                    "resOriginalAltFileType",
+                    "resOriginalAltFingerprint",
+                    "resOriginalAltRes",
+                    "resOriginalVidComplWidth",
+                    "resOriginalVidComplHeight",
+                    "resOriginalVidComplFileType",
+                    "resOriginalVidComplFingerprint",
+                    "resOriginalVidComplRes",
+                    "isDeleted",
+                    "isExpunged",
+                    "dateExpunged",
+                    "remappedRef",
+                    "recordName",
+                    "recordType",
+                    "recordChangeTag",
+                    "masterRef",
+                    "adjustmentRenderType",
+                    "assetDate",
+                    "addedDate",
+                    "isFavorite",
+                    "isHidden",
+                    "orientation",
+                    "duration",
+                    "assetSubtype",
+                    "assetSubtypeV2",
+                    "assetHDRType",
+                    "burstFlags",
+                    "burstFlagsExt",
+                    "burstId",
+                    "captionEnc",
+                    "locationEnc",
+                    "locationV2Enc",
+                    "locationLatitude",
+                    "locationLongitude",
+                    "adjustmentType",
+                    "timeZoneOffset",
+                    "vidComplDurValue",
+                    "vidComplDurScale",
+                    "vidComplDispValue",
+                    "vidComplDispScale",
+                    "vidComplVisibilityState",
+                    "customRenderedValue",
+                    "containerId",
+                    "itemId",
+                    "position",
+                    "isKeyAsset",
+                ],
+                "zoneID": {"zoneName": "PrimarySync"},
+            },
+            "response": {
+                "records": [],
+                "syncToken": "AQAAAAAAArKjf//////////fSxWSKv5JfZ34edrt875d",
+            },
+        },
+        {
+            "data": {
+                "query": {
+                    "filterBy": [
+                        {
+                            "fieldName": "startRank",
+                            "fieldValue": {"type": "INT64", "value": 5},
+                            "comparator": "EQUALS",
+                        },
+                        {
+                            "fieldName": "direction",
+                            "fieldValue": {"type": "STRING", "value": "ASCENDING"},
+                            "comparator": "EQUALS",
+                        },
+                        {
+                            "fieldName": "parentId",
+                            "comparator": "EQUALS",
+                            "fieldValue": {
+                                "type": "STRING",
+                                "value": "E803E065-D8A4-4398-DE23-23F8FD0886EC",
+                            },
+                        },
+                    ],
+                    "recordType": "CPLContainerRelationLiveByAssetDate",
+                },
+                "resultsLimit": 200,
+                "desiredKeys": [
+                    "resJPEGFullWidth",
+                    "resJPEGFullHeight",
+                    "resJPEGFullFileType",
+                    "resJPEGFullFingerprint",
+                    "resJPEGFullRes",
+                    "resJPEGLargeWidth",
+                    "resJPEGLargeHeight",
+                    "resJPEGLargeFileType",
+                    "resJPEGLargeFingerprint",
+                    "resJPEGLargeRes",
+                    "resJPEGMedWidth",
+                    "resJPEGMedHeight",
+                    "resJPEGMedFileType",
+                    "resJPEGMedFingerprint",
+                    "resJPEGMedRes",
+                    "resJPEGThumbWidth",
+                    "resJPEGThumbHeight",
+                    "resJPEGThumbFileType",
+                    "resJPEGThumbFingerprint",
+                    "resJPEGThumbRes",
+                    "resVidFullWidth",
+                    "resVidFullHeight",
+                    "resVidFullFileType",
+                    "resVidFullFingerprint",
+                    "resVidFullRes",
+                    "resVidMedWidth",
+                    "resVidMedHeight",
+                    "resVidMedFileType",
+                    "resVidMedFingerprint",
+                    "resVidMedRes",
+                    "resVidSmallWidth",
+                    "resVidSmallHeight",
+                    "resVidSmallFileType",
+                    "resVidSmallFingerprint",
+                    "resVidSmallRes",
+                    "resSidecarWidth",
+                    "resSidecarHeight",
+                    "resSidecarFileType",
+                    "resSidecarFingerprint",
+                    "resSidecarRes",
+                    "itemType",
+                    "dataClassType",
+                    "filenameEnc",
+                    "originalOrientation",
+                    "resOriginalWidth",
+                    "resOriginalHeight",
+                    "resOriginalFileType",
+                    "resOriginalFingerprint",
+                    "resOriginalRes",
+                    "resOriginalAltWidth",
+                    "resOriginalAltHeight",
+                    "resOriginalAltFileType",
+                    "resOriginalAltFingerprint",
+                    "resOriginalAltRes",
+                    "resOriginalVidComplWidth",
+                    "resOriginalVidComplHeight",
+                    "resOriginalVidComplFileType",
+                    "resOriginalVidComplFingerprint",
+                    "resOriginalVidComplRes",
+                    "isDeleted",
+                    "isExpunged",
+                    "dateExpunged",
+                    "remappedRef",
+                    "recordName",
+                    "recordType",
+                    "recordChangeTag",
+                    "masterRef",
+                    "adjustmentRenderType",
+                    "assetDate",
+                    "addedDate",
+                    "isFavorite",
+                    "isHidden",
+                    "orientation",
+                    "duration",
+                    "assetSubtype",
+                    "assetSubtypeV2",
+                    "assetHDRType",
+                    "burstFlags",
+                    "burstFlagsExt",
+                    "burstId",
+                    "captionEnc",
+                    "locationEnc",
+                    "locationV2Enc",
+                    "locationLatitude",
+                    "locationLongitude",
+                    "adjustmentType",
+                    "timeZoneOffset",
+                    "vidComplDurValue",
+                    "vidComplDurScale",
+                    "vidComplDispValue",
+                    "vidComplDispScale",
+                    "vidComplVisibilityState",
+                    "customRenderedValue",
+                    "containerId",
+                    "itemId",
+                    "position",
+                    "isKeyAsset",
+                ],
+                "zoneID": {"zoneName": "PrimarySync"},
+            },
+            "response": {
+                "records": [],
+                "syncToken": "AQAAAAAAArKjf//////////fSxWSKv5JfZ34edrt875d",
+            },
+        },
     ],
     "query/batch?remapEnums=True&getCurrentSyncToken=True": [
         {
diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py
index 78d6fd25..38b4d232 100644
--- a/tests/test_config_parser.py
+++ b/tests/test_config_parser.py
@@ -281,7 +281,7 @@ class TestConfigParser(unittest.TestCase):
         )
         self.assertTrue(os.path.exists(actual))
         self.assertTrue(os.path.isdir(actual))
-        os.rmdir(actual)
+        shutil.rmtree(actual)
 
     def test_prepare_photos_destination_default(self):
         """Default photos destination."""
diff --git a/tests/test_sync_photos.py b/tests/test_sync_photos.py
index 0287b475..85d9e8af 100644
--- a/tests/test_sync_photos.py
+++ b/tests/test_sync_photos.py
@@ -58,7 +58,7 @@ class TestSyncPhotos(unittest.TestCase):
         )
         self.assertTrue(os.path.isdir(album_0_path))
         self.assertTrue(os.path.isdir(album_1_path))
-        self.assertTrue(len(os.listdir(album_0_path)) > 0)
+        self.assertTrue(len(os.listdir(album_0_path)) > 1)
         self.assertTrue(len(os.listdir(album_1_path)) > 0)
 
     @patch(target="keyring.get_password", return_value=data.VALID_PASSWORD)
@@ -426,7 +426,7 @@ class TestSyncPhotos(unittest.TestCase):
         )
         self.assertTrue(os.path.isdir(album_0_path))
         self.assertTrue(os.path.isdir(album_1_path))
-        self.assertTrue(len(os.listdir(album_0_path)) > 0)
+        self.assertTrue(len(os.listdir(album_0_path)) > 1)
         self.assertTrue(len(os.listdir(album_1_path)) > 0)
 
     @patch(target="keyring.get_password", return_value=data.VALID_PASSWORD)
@@ -456,5 +456,5 @@ class TestSyncPhotos(unittest.TestCase):
         )
         self.assertTrue(os.path.isdir(album_0_path))
         self.assertTrue(os.path.isdir(album_1_path))
-        self.assertTrue(len(os.listdir(album_0_path)) == 0)
+        self.assertTrue(len(os.listdir(album_0_path)) == 1)
         self.assertTrue(len(os.listdir(album_1_path)) == 0)