diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index ce1ba6306b..4ea0725c36 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -115,9 +115,8 @@ def __exit__(self, exc_type, exc_val, exc_tb): class MockEngine(Engine): def __init__(self, tmp_path): local_folder = tmp_path - version = 1 - super().__init__(self, local_folder, version) + super().__init__(self, local_folder) class MockedClient: @@ -156,20 +155,22 @@ def manager_dao(tmp_path): return dao +@pytest.fixture +def remote(): + mocked_remote = MockedRemote() + return mocked_remote + + @pytest.fixture() def engine(engine_dao): engine = MockEngine engine.local_folder = os.path.expandvars("C:\\test\\%username%\\Drive") engine.dao = engine_dao + engine.version = 1 + engine.remote = remote() return engine -@pytest.fixture -def remote(): - mocked_remote = MockedRemote() - return mocked_remote - - @pytest.fixture() def manager(tmp_path): manager = MockManager diff --git a/tests/unit/test_processor.py b/tests/unit/test_processor.py index 1b3f2795ae..07ec3fa1ce 100644 --- a/tests/unit/test_processor.py +++ b/tests/unit/test_processor.py @@ -5,10 +5,10 @@ from nxdrive.engine.processor import Processor -def test_synchronize_direct_transfer(engine, engine_dao, remote, tmp_path): +def test_synchronize_direct_transfer(engine, engine_dao, tmp_path): engine = engine(tmp_path) dao = engine_dao() - remote = remote + remote = engine.remote Mocked_Session = namedtuple( "session", "status, uid",