diff --git a/.gitignore b/.gitignore index 417507f3..f57d06c5 100644 --- a/.gitignore +++ b/.gitignore @@ -103,7 +103,6 @@ celerybeat.pid *.sage.py # Environments -.env .venv env/ venv/ diff --git a/src/sync.py b/src/sync.py index 0f4fc593..1e5d409d 100644 --- a/src/sync.py +++ b/src/sync.py @@ -63,12 +63,12 @@ def sync(): username = config_parser.get_username(config=config) if username: try: + server_region = config_parser.get_region(config=config) if ENV_ICLOUD_PASSWORD_KEY in os.environ: password = os.environ.get(ENV_ICLOUD_PASSWORD_KEY) utils.store_password_in_keyring(username=username, password=password) else: password = utils.get_password_from_keyring(username=username) - server_region = config_parser.get_region(config=config) api = get_api_instance(username=username, password=password, server_region=server_region) if not api.requires_2sa: if "drive" in config and enable_sync_drive: diff --git a/tests/.env b/tests/.env new file mode 100644 index 00000000..c02d47b3 --- /dev/null +++ b/tests/.env @@ -0,0 +1 @@ +ENV_CONFIG_FILE_PATH=./tests/data/test_config.yaml \ No newline at end of file