Skip to content

Commit

Permalink
Add export.Service signal for clarity and consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalo-bulnes committed Dec 30, 2022
1 parent 71f2317 commit fbc4327
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion securedrop_client/export/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Service(QObject):
printer_not_found_ready = pyqtSignal(object)
print_failed = pyqtSignal(object)
print_succeeded = pyqtSignal()
print_finished = pyqtSignal(list)

def __init__(
self,
Expand Down Expand Up @@ -72,6 +73,7 @@ def __init__(
self.export_succeeded.connect(self.export_usb_call_success)
self.export_failed.connect(self.export_usb_call_failure)
self.export_finished.connect(self.export_completed)
self.print_finished.connect(self.export_completed)

def connect_signals(
self,
Expand Down Expand Up @@ -171,7 +173,7 @@ def print(self, filepaths: List[str]) -> None:
logger.debug(f"Export failed: {e}")
self.print_failed.emit(e)

self.export_completed.emit(filepaths)
self.print_finished.emit(filepaths)


# Store the service instance to prevent unnecessary concurrent access to the CLI. See getService.
Expand Down
2 changes: 2 additions & 0 deletions tests/export/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ def test_emits_printer_not_found_ready_when_printer_status_check_fails(
assert len(printer_not_found_ready_emissions) == 1
assert printer_not_found_ready_emissions[0] == [expected_error]

# FIXME Add printer's printing API tests

# FIXME Add disk API tests

0 comments on commit fbc4327

Please sign in to comment.