Skip to content

Commit

Permalink
NXDRIVE-2889: Display system notification for document review
Browse files Browse the repository at this point in the history
  • Loading branch information
swetayadav1 committed Apr 3, 2024
1 parent ce92e33 commit e0f2328
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
7 changes: 3 additions & 4 deletions nxdrive/gui/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ def __init__(self, manager: "Manager", *args: Any) -> None:
self._setup_notification_center()

# Initiate workflow when drive starts
self.workflow, current_uid, engine = self.init_workflow() # type: ignore
self.workflow.get_pending_tasks(current_uid, engine)

self.workflow = self.init_workflow() # type: ignore

Check warning on line 222 in nxdrive/gui/application.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/application.py#L222

Added line #L222 was not covered by tests
# Application update
self.manager.updater.appUpdated.connect(self.quit)
self.manager.updater.serverIncompatible.connect(self._server_incompatible)
Expand Down Expand Up @@ -384,7 +382,8 @@ def init_workflow(self): # type: ignore
current_uid = self.engine_model.engines_uid[0]
engine = self.manager.engines[current_uid]
self.workflow = Workflow(engine.remote)
return self.workflow, current_uid, engine
self.workflow.get_pending_tasks(engine)
return self.workflow

Check warning on line 386 in nxdrive/gui/application.py

View check run for this annotation

Codecov / codecov/patch

nxdrive/gui/application.py#L381-L386

Added lines #L381 - L386 were not covered by tests

def _update_feature_state(self, name: str, value: bool, /) -> None:
"""Check if the feature model exists from *name* then update it with *value*."""
Expand Down
19 changes: 16 additions & 3 deletions tests/unit/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,20 @@ def test_api_display_pending_task_with_exec(application, manager):
)


def test_init_workflow_with_app(application):
application.manager.engines = {"engine_uid_1": Mock(), "engine_uid_2": Mock()}
def test_init_workflow_with_app(tmp_path):
from nxdrive.manager import Manager

application.init_gui()
manager = Manager(tmp_path)
manager.db_backup_worker = Mock()

manager.autolock_service = Mock()
manager.server_config_updater = Mock()
manager._create_server_config_updater = Mock()
manager.sync_and_quit_worker = Mock()
manager._create_db_backup_worker = Mock()
manager._create_workflow_worker = Mock()

app = Application(manager)

app.init_workflow()
app.exit_app()

0 comments on commit e0f2328

Please sign in to comment.