-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check folder structure for correct format
- Loading branch information
1 parent
acde800
commit 6ba257d
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,3 +209,38 @@ def test_folder_structure_de_posix(self) -> None: | |
assert os.path.exists( | ||
os.path.join(data_dir, os.path.normpath(file_name)) | ||
), f"File {file_name} expected, but does not exist" | ||
|
||
def test_folder_structure_bad_format(self) -> None: | ||
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3]) | ||
|
||
files_to_create: List[Tuple[str, str, int]] = [] | ||
files_to_download: List[Tuple[str, str]] = [] | ||
|
||
# Note - This test uses the same cassette as test_download_photos.py | ||
data_dir, result = run_icloudpd_test( | ||
self.assertEqual, | ||
self.vcr_path, | ||
base_dir, | ||
"listing_photos.yml", | ||
files_to_create, | ||
files_to_download, | ||
[ | ||
"--username", | ||
"[email protected]", | ||
"--password", | ||
"password1", | ||
"--recent", | ||
"5", | ||
"--only-print-filenames", | ||
"--folder-structure={%Y}{%Y}", | ||
"--no-progress-bar", | ||
"--threads-num", | ||
"1", | ||
], | ||
) | ||
|
||
assert result.exit_code == 2 | ||
|
||
messages = result.output.splitlines() | ||
|
||
self.assertTrue("Format specified in --folder-structure is incorrect" in messages) |