From d732eb203475e1b4b115344f073179eca088decf Mon Sep 17 00:00:00 2001 From: Sam Schott Date: Tue, 8 Feb 2022 00:23:04 +0100 Subject: [PATCH] adapt test imports --- tests/linked/conftest.py | 4 ++-- tests/linked/test_client.py | 2 +- tests/linked/test_main.py | 4 ++-- tests/linked/test_sync.py | 4 ++-- tests/offline/test_client.py | 18 +++++++++--------- tests/offline/test_daemon.py | 2 +- tests/offline/test_ignoring_events.py | 3 ++- tests/offline/test_manager.py | 2 +- tests/offline/utils/test_serializer.py | 2 +- 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/linked/conftest.py b/tests/linked/conftest.py index 3ca479f4..5ed7b7b0 100644 --- a/tests/linked/conftest.py +++ b/tests/linked/conftest.py @@ -8,8 +8,8 @@ import pytest from dropbox.files import WriteMode, FileMetadata from maestral.main import Maestral -from maestral.errors import NotFoundError, FileConflictError -from maestral.client import convert_api_errors +from maestral.exceptions import NotFoundError, FileConflictError +from maestral.errorhandling import convert_api_errors from maestral.config import remove_configuration from maestral.utils.path import ( generate_cc_name, diff --git a/tests/linked/test_client.py b/tests/linked/test_client.py index aeb1def8..3b6debf3 100644 --- a/tests/linked/test_client.py +++ b/tests/linked/test_client.py @@ -4,7 +4,7 @@ import pytest from dropbox.files import FolderMetadata from dropbox.sharing import SharedFolderMetadata -from maestral.errors import NotFoundError, PathError +from maestral.exceptions import NotFoundError, PathError from maestral.utils.path import normalize from .conftest import resources diff --git a/tests/linked/test_main.py b/tests/linked/test_main.py index 9bd8592f..9b6181dd 100644 --- a/tests/linked/test_main.py +++ b/tests/linked/test_main.py @@ -7,13 +7,13 @@ import subprocess import pytest -from maestral.errors import ( +from maestral.exceptions import ( NotFoundError, UnsupportedFileTypeForDiff, SharedLinkError, SyncError, ) -from maestral.main import FileStatus, IDLE +from maestral.constants import FileStatus, IDLE from maestral.utils.path import delete, normalize from maestral.utils.integration import get_inotify_limits diff --git a/tests/linked/test_sync.py b/tests/linked/test_sync.py index d44f64ee..27c18082 100644 --- a/tests/linked/test_sync.py +++ b/tests/linked/test_sync.py @@ -9,7 +9,7 @@ import pytest from watchdog.utils.dirsnapshot import DirectorySnapshot from watchdog.events import FileCreatedEvent from dropbox.files import WriteMode -from maestral.database import SyncEvent +from maestral.models import SyncEvent from maestral.utils import sanitize_string from maestral.utils.appdirs import get_home_dir from maestral.utils.path import ( @@ -19,7 +19,7 @@ from maestral.utils.path import ( normalize, fs_max_lengths_for_path, ) -from maestral.errors import PathError +from maestral.exceptions import PathError from .conftest import assert_synced, wait_for_idle, resources diff --git a/tests/offline/test_client.py b/tests/offline/test_client.py index b5b962e4..7b68bf42 100644 --- a/tests/offline/test_client.py +++ b/tests/offline/test_client.py @@ -12,7 +12,7 @@ from dropbox.sharing import * from dropbox.auth import * from dropbox.common import * -from maestral.errors import ( +from maestral.exceptions import ( MaestralApiError, InvalidDbidError, DropboxAuthError, @@ -38,13 +38,13 @@ from maestral.errors import ( FileConflictError, FolderConflictError, ) -from maestral.errors import PathRootError as MPRE -from maestral.client import ( +from maestral.exceptions import PathRootError as MPRE +from maestral.errorhandling import ( os_to_maestral_error, dropbox_to_maestral_error, - _get_lookup_error_msg, - _get_write_error_msg, - _get_session_lookup_error_msg, + get_lookup_error_msg, + get_write_error_msg, + get_session_lookup_error_msg, ) @@ -83,7 +83,7 @@ def test_os_to_maestral_error(number, maestral_exc): ], ) def test_get_lookup_error_msg(error, maestral_exc): - text, err_cls = _get_lookup_error_msg(error) + text, err_cls = get_lookup_error_msg(error) assert err_cls is maestral_exc @@ -102,7 +102,7 @@ def test_get_lookup_error_msg(error, maestral_exc): ], ) def test_get_write_error_msg(error, maestral_exc): - text, err_cls = _get_write_error_msg(error) + text, err_cls = get_write_error_msg(error) assert err_cls is maestral_exc @@ -120,7 +120,7 @@ def test_get_write_error_msg(error, maestral_exc): ], ) def test_get_session_lookup_error_msg(error, maestral_exc): - text, err_cls = _get_session_lookup_error_msg(error) + text, err_cls = get_session_lookup_error_msg(error) assert err_cls is maestral_exc diff --git a/tests/offline/test_daemon.py b/tests/offline/test_daemon.py index 730141f0..58f5bf7f 100644 --- a/tests/offline/test_daemon.py +++ b/tests/offline/test_daemon.py @@ -18,7 +18,7 @@ from maestral.daemon import ( Lock, ) from maestral.main import Maestral -from maestral.errors import NotLinkedError +from maestral.exceptions import NotLinkedError # locking tests diff --git a/tests/offline/test_ignoring_events.py b/tests/offline/test_ignoring_events.py index 711d0e36..e6011608 100644 --- a/tests/offline/test_ignoring_events.py +++ b/tests/offline/test_ignoring_events.py @@ -3,7 +3,8 @@ from pathlib import Path from watchdog.events import DirCreatedEvent, DirMovedEvent -from maestral.sync import SyncDirection, ItemType, ChangeType +from maestral.sync import SyncDirection +from maestral.models import ItemType, ChangeType from maestral.utils.path import move diff --git a/tests/offline/test_manager.py b/tests/offline/test_manager.py index 87faad98..17742a7d 100644 --- a/tests/offline/test_manager.py +++ b/tests/offline/test_manager.py @@ -5,7 +5,7 @@ import pytest from dropbox.users import FullAccount from dropbox.common import TeamRootInfo, UserRootInfo -from maestral.errors import NoDropboxDirError +from maestral.exceptions import NoDropboxDirError from maestral.utils.appdirs import get_home_dir from maestral.utils.path import generate_cc_name, delete diff --git a/tests/offline/utils/test_serializer.py b/tests/offline/utils/test_serializer.py index 6a54b592..1ff6f33a 100644 --- a/tests/offline/utils/test_serializer.py +++ b/tests/offline/utils/test_serializer.py @@ -3,7 +3,7 @@ import builtins import pytest from requests.exceptions import RequestException -from maestral.errors import SyncError +from maestral.exceptions import SyncError from maestral.utils.serializer import error_to_dict