mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
- Repair is run within an operation. - Diagnostics are run for the app first. - Call app.repair, then re-run setup if needed. - Add helper functions for apps or components to store error messages in thread local storage. These error messages are shown at the end. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> [sunil: Undo minor reformatting, due to automatic tool] [sunil: Fix passing incorrect Exception argument to operation.on_update] [sunil: Add full stop at the end of the success message to match install message] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
20 lines
558 B
Python
20 lines
558 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""
|
|
Test module for setup module.
|
|
"""
|
|
|
|
from plinth.setup import store_error_message, retrieve_error_messages
|
|
|
|
|
|
def test_store_retrieve_error_message():
|
|
"""Test storing and retrieving error messages."""
|
|
store_error_message('error 1')
|
|
assert retrieve_error_messages() == ['error 1']
|
|
|
|
store_error_message('error 1')
|
|
store_error_message('error 2')
|
|
assert retrieve_error_messages() == ['error 1', 'error 2']
|
|
|
|
# errors are cleared after retrieving
|
|
assert retrieve_error_messages() == []
|