tor: tests: Convert to pytest style tests from class based tests

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-02-15 10:33:45 -08:00 committed by James Valleroy
parent 37b9e21e30
commit 3aae4b39d6
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -11,10 +11,6 @@ from django.core.exceptions import ValidationError
from plinth.modules.tor import forms, utils from plinth.modules.tor import forms, utils
class TestTor:
"""Test cases for testing the Tor module."""
@staticmethod
@patch('plinth.app.App.get') @patch('plinth.app.App.get')
@pytest.mark.usefixtures('needs_root', 'load_cfg') @pytest.mark.usefixtures('needs_root', 'load_cfg')
def test_get_status(_app_get): def test_get_status(_app_get):
@ -26,10 +22,6 @@ class TestTor:
utils.get_status() utils.get_status()
class TestTorForm:
"""Test whether Tor configration form works."""
@staticmethod
def test_bridge_validator(): def test_bridge_validator():
"""Test upstream bridges' form field validator.""" """Test upstream bridges' form field validator."""
validator = forms.bridges_validator validator = forms.bridges_validator