From e638dfa9422e56dfe2d4b526b013ba9b70f69d09 Mon Sep 17 00:00:00 2001 From: Anindya Roy Date: Fri, 1 Dec 2023 13:02:23 +0530 Subject: [PATCH] NXDRIVE-2860: Code Coverage - fixed test_open_document --- tests/functional/test_api.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/functional/test_api.py b/tests/functional/test_api.py index 62728feb69..ea09cf0021 100644 --- a/tests/functional/test_api.py +++ b/tests/functional/test_api.py @@ -136,6 +136,7 @@ def func(*args): def test_open_document(manager_factory): manager, engine = manager_factory() manager.application = "" + engine.uid = "dummy_uid" def mocked_open_authentication_dialog(): return @@ -143,9 +144,6 @@ def mocked_open_authentication_dialog(): def mocked_hide_systray(*args): return - def func(*args): - return True - Mocked_App = namedtuple( "app", "manager, open_authentication_dialog, hide_systray", @@ -155,9 +153,8 @@ def func(*args): drive_api = QMLDriveApi(app) with manager: - with patch.object(manager.engines, "get", new=func): - returned_val = drive_api.open_document("engine_uid", 1) - assert not returned_val + returned_val = drive_api.open_document("engine_uid", 1) + assert not returned_val def test_open_remote_document(manager_factory):