mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
transmission: 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:
parent
452f8b825b
commit
b94833e44d
@ -11,36 +11,20 @@ from plinth.tests import functional
|
|||||||
pytestmark = [pytest.mark.apps, pytest.mark.transmission, pytest.mark.sso]
|
pytestmark = [pytest.mark.apps, pytest.mark.transmission, pytest.mark.sso]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='module', autouse=True)
|
class TestTransmissionApp(functional.BaseAppTests):
|
||||||
def fixture_background(session_browser):
|
app_name = 'transmission'
|
||||||
"""Login and install the app."""
|
has_service = False
|
||||||
functional.login(session_browser)
|
has_web = True
|
||||||
functional.install(session_browser, 'transmission')
|
|
||||||
yield
|
|
||||||
functional.app_disable(session_browser, 'transmission')
|
|
||||||
|
|
||||||
|
def test_upload_torrent(self, session_browser):
|
||||||
def test_enable_disable(session_browser):
|
|
||||||
"""Test enabling the app."""
|
|
||||||
functional.app_disable(session_browser, 'transmission')
|
|
||||||
|
|
||||||
functional.app_enable(session_browser, 'transmission')
|
|
||||||
assert functional.is_available(session_browser, 'transmission')
|
|
||||||
|
|
||||||
functional.app_disable(session_browser, 'transmission')
|
|
||||||
assert not functional.is_available(session_browser, 'transmission')
|
|
||||||
|
|
||||||
|
|
||||||
def test_upload_torrent(session_browser):
|
|
||||||
"""Test uploading a torrent to Transmission."""
|
"""Test uploading a torrent to Transmission."""
|
||||||
functional.app_enable(session_browser, 'transmission')
|
functional.app_enable(session_browser, 'transmission')
|
||||||
_remove_all_torrents(session_browser)
|
_remove_all_torrents(session_browser)
|
||||||
_upload_sample_torrent(session_browser)
|
_upload_sample_torrent(session_browser)
|
||||||
_assert_number_of_torrents(session_browser, 1)
|
_assert_number_of_torrents(session_browser, 1)
|
||||||
|
|
||||||
|
@pytest.mark.backups
|
||||||
@pytest.mark.backups
|
def test_backup_restore(self, session_browser):
|
||||||
def test_backup_restore(session_browser):
|
|
||||||
"""Test backup and restore of app data."""
|
"""Test backup and restore of app data."""
|
||||||
functional.app_enable(session_browser, 'transmission')
|
functional.app_enable(session_browser, 'transmission')
|
||||||
_remove_all_torrents(session_browser)
|
_remove_all_torrents(session_browser)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user