From 71f42cea205921cb9578afc202fe3d73ef67d6d6 Mon Sep 17 00:00:00 2001 From: Andrey Nikiforov Date: Sat, 31 Aug 2024 21:50:45 -0700 Subject: [PATCH] ensure test are green without internet connection (#943) --- pyproject.toml | 2 +- tests/test_authentication.py | 2 +- tests/test_autodelete_photos.py | 3 ++- tests/test_cli.py | 2 +- tests/test_download_live_photos.py | 2 +- tests/test_download_live_photos_id.py | 2 +- tests/test_download_photos.py | 2 +- tests/test_download_photos_id.py | 2 +- tests/test_email_notifications.py | 2 +- tests/test_folder_structure.py | 2 +- tests/test_listing_albums.py | 2 +- tests/test_listing_libraries.py | 2 +- tests/test_listing_recent_photos.py | 2 +- tests/test_two_step_auth.py | 2 +- 14 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 899340a9b..9b1a720b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ test = [ "pytest==7.4.3", "mock==5.1.0", "freezegun==1.5.1", - "vcrpy==4.4.0", + "vcrpy==6.0.1", "pytest-cov==4.1.0", "ruff==0.5.0", "coveralls==3.3.1", diff --git a/tests/test_authentication.py b/tests/test_authentication.py index cd2a02efd..f4ae78b23 100644 --- a/tests/test_authentication.py +++ b/tests/test_authentication.py @@ -19,7 +19,7 @@ from tests.helpers import path_from_project_root, recreate_path -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class AuthenticationTestCase(TestCase): diff --git a/tests/test_autodelete_photos.py b/tests/test_autodelete_photos.py index 5493f301e..cc0c6de4a 100644 --- a/tests/test_autodelete_photos.py +++ b/tests/test_autodelete_photos.py @@ -19,7 +19,7 @@ from tests.helpers import path_from_project_root, print_result_exception, recreate_path -vcr = VCR(decode_compressed_response=True, record_mode="new_episodes") +vcr = VCR(decode_compressed_response=True, record_mode="none") class AutodeletePhotosTestCase(TestCase): @@ -68,6 +68,7 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn: cookie_dir, ], ) + print_result_exception(result) self.assertIn( "DEBUG Looking up all photos and videos from album All Photos...", diff --git a/tests/test_cli.py b/tests/test_cli.py index 9f78135b8..d5a86ca8a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -12,7 +12,7 @@ from tests.helpers import path_from_project_root, print_result_exception, recreate_path -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class CliTestCase(TestCase): diff --git a/tests/test_download_live_photos.py b/tests/test_download_live_photos.py index 57a96db3a..f0c3510e0 100644 --- a/tests/test_download_live_photos.py +++ b/tests/test_download_live_photos.py @@ -11,7 +11,7 @@ run_icloudpd_test, ) -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class DownloadLivePhotoTestCase(TestCase): diff --git a/tests/test_download_live_photos_id.py b/tests/test_download_live_photos_id.py index 19bc29144..1b0a85c67 100644 --- a/tests/test_download_live_photos_id.py +++ b/tests/test_download_live_photos_id.py @@ -10,7 +10,7 @@ run_icloudpd_test, ) -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class DownloadLivePhotoNameIDTestCase(TestCase): diff --git a/tests/test_download_photos.py b/tests/test_download_photos.py index 05a2815a9..abe9a99d0 100644 --- a/tests/test_download_photos.py +++ b/tests/test_download_photos.py @@ -30,7 +30,7 @@ run_icloudpd_test, ) -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class DownloadPhotoTestCase(TestCase): diff --git a/tests/test_download_photos_id.py b/tests/test_download_photos_id.py index 8438e1c6a..c8c3947f2 100644 --- a/tests/test_download_photos_id.py +++ b/tests/test_download_photos_id.py @@ -31,7 +31,7 @@ run_icloudpd_test, ) -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class DownloadPhotoNameIDTestCase(TestCase): diff --git a/tests/test_email_notifications.py b/tests/test_email_notifications.py index e282d8026..1b9d56ca5 100644 --- a/tests/test_email_notifications.py +++ b/tests/test_email_notifications.py @@ -11,7 +11,7 @@ from tests.helpers import path_from_project_root, recreate_path -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class EmailNotificationsTestCase(TestCase): diff --git a/tests/test_folder_structure.py b/tests/test_folder_structure.py index c1f0b3e13..2af7717a7 100644 --- a/tests/test_folder_structure.py +++ b/tests/test_folder_structure.py @@ -17,7 +17,7 @@ run_icloudpd_test, ) -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class FolderStructureTestCase(TestCase): diff --git a/tests/test_listing_albums.py b/tests/test_listing_albums.py index 50c9c4070..bb922c842 100644 --- a/tests/test_listing_albums.py +++ b/tests/test_listing_albums.py @@ -10,7 +10,7 @@ from tests.helpers import path_from_project_root, print_result_exception, recreate_path -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class ListingAlbumsTestCase(TestCase): diff --git a/tests/test_listing_libraries.py b/tests/test_listing_libraries.py index 1b88a0df7..55d41d374 100644 --- a/tests/test_listing_libraries.py +++ b/tests/test_listing_libraries.py @@ -9,7 +9,7 @@ from tests.helpers import path_from_project_root, print_result_exception, recreate_path -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class ListingLibraryTestCase(TestCase): diff --git a/tests/test_listing_recent_photos.py b/tests/test_listing_recent_photos.py index d50042cbf..25aa5ea31 100644 --- a/tests/test_listing_recent_photos.py +++ b/tests/test_listing_recent_photos.py @@ -11,7 +11,7 @@ from tests.helpers import path_from_project_root, print_result_exception, recreate_path -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class ListingRecentPhotosTestCase(TestCase): diff --git a/tests/test_two_step_auth.py b/tests/test_two_step_auth.py index edb01552f..483d7c91b 100644 --- a/tests/test_two_step_auth.py +++ b/tests/test_two_step_auth.py @@ -10,7 +10,7 @@ from tests.helpers import path_from_project_root, recreate_path -vcr = VCR(decode_compressed_response=True) +vcr = VCR(decode_compressed_response=True, record_mode="none") class TwoStepAuthTestCase(TestCase):