Skip to content

Commit

Permalink
NXDRIVE-2860: Code Coverage - fixed test_open_document
Browse files Browse the repository at this point in the history
  • Loading branch information
gitofanindya committed Dec 1, 2023
1 parent c18102b commit e638dfa
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/functional/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,14 @@ 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

def mocked_hide_systray(*args):
return

def func(*args):
return True

Mocked_App = namedtuple(
"app",
"manager, open_authentication_dialog, hide_systray",
Expand All @@ -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):
Expand Down

0 comments on commit e638dfa

Please sign in to comment.