Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide "Preparing export" message when error occurs during preparation stage #562

Merged
merged 1 commit into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,7 @@ def _update(self, status):
else:
self.error_status_code.setText(_(status))
self.generic_error.show()
self.starting_export_message.hide()
self.passphrase_form.hide()
self.insert_usb_form.hide()

Expand Down
5 changes: 4 additions & 1 deletion tests/gui/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ def test_ExportDialog__update_after_DISK_ENCRYPTION_NOT_SUPPORTED_ERROR(mocker):
export_dialog._request_to_insert_usb_device.assert_called_once_with(True)


def test_ExportDialog__update_after_CALLED_PROCESS_ERROR_ERROR(mocker):
def test_ExportDialog__update_after_CALLED_PROCESS_ERROR(mocker):
"""
Ensure CALLED_PROCESS_ERROR shows generic 'contant admin' error with correct
error status code.
Expand All @@ -1683,6 +1683,9 @@ def test_ExportDialog__update_after_CALLED_PROCESS_ERROR_ERROR(mocker):

export_dialog._update(ExportStatus.CALLED_PROCESS_ERROR.value)

assert export_dialog.starting_export_message.isHidden()
assert export_dialog.passphrase_form.isHidden()
assert export_dialog.insert_usb_form.isHidden()
assert not export_dialog.generic_error.isHidden()
assert export_dialog.error_status_code.text() == 'CALLED_PROCESS_ERROR'
export_dialog._request_to_insert_usb_device.assert_not_called()
Expand Down