mumble: Use BaseAppTests for functional tests

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2021-10-16 09:12:13 -04:00 committed by Sunil Mohan Adapa
parent fae88d9fff
commit ed46278550
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -4,36 +4,19 @@ Functional, browser based tests for mumble app.
"""
import pytest
from plinth.tests import functional
from plinth.tests.functional import BaseAppTests
pytestmark = [pytest.mark.apps, pytest.mark.mumble]
@pytest.fixture(scope='module', autouse=True)
def fixture_background(session_browser):
"""Login and install the app."""
functional.login(session_browser)
functional.install(session_browser, 'mumble')
yield
functional.app_disable(session_browser, 'mumble')
class TestMumbleApp(BaseAppTests):
app_name = 'mumble'
has_service = True
has_web = False
# TODO: Requires a valid domain with certificates to complete setup.
check_diagnostics = False
def test_enable_disable(session_browser):
"""Test enabling the app."""
functional.app_disable(session_browser, 'mumble')
functional.app_enable(session_browser, 'mumble')
assert functional.service_is_running(session_browser, 'mumble')
functional.app_disable(session_browser, 'mumble')
assert functional.service_is_not_running(session_browser, 'mumble')
# TODO: Improve this to actually check that data such as rooms, identity or
# certificates are restored.
def test_backup_restore(session_browser):
"""Test backup and restore."""
functional.app_enable(session_browser, 'mumble')
functional.backup_create(session_browser, 'mumble', 'test_mumble')
functional.backup_restore(session_browser, 'mumble', 'test_mumble')
assert functional.service_is_running(session_browser, 'mumble')
# TODO: Improve test_backup_restore to actually check that data such
# as rooms, identity or certificates are restored.