mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
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:
parent
37b9e21e30
commit
3aae4b39d6
@ -11,13 +11,9 @@ from django.core.exceptions import ValidationError
|
|||||||
from plinth.modules.tor import forms, utils
|
from plinth.modules.tor import forms, utils
|
||||||
|
|
||||||
|
|
||||||
class TestTor:
|
@patch('plinth.app.App.get')
|
||||||
"""Test cases for testing the Tor module."""
|
@pytest.mark.usefixtures('needs_root', 'load_cfg')
|
||||||
|
def test_get_status(_app_get):
|
||||||
@staticmethod
|
|
||||||
@patch('plinth.app.App.get')
|
|
||||||
@pytest.mark.usefixtures('needs_root', 'load_cfg')
|
|
||||||
def test_get_status(_app_get):
|
|
||||||
"""Test that get_status does not raise any unhandled exceptions.
|
"""Test that get_status does not raise any unhandled exceptions.
|
||||||
|
|
||||||
This should work regardless of whether tor is installed, or
|
This should work regardless of whether tor is installed, or
|
||||||
@ -26,11 +22,7 @@ class TestTor:
|
|||||||
utils.get_status()
|
utils.get_status()
|
||||||
|
|
||||||
|
|
||||||
class TestTorForm:
|
def test_bridge_validator():
|
||||||
"""Test whether Tor configration form works."""
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def test_bridge_validator():
|
|
||||||
"""Test upstream bridges' form field validator."""
|
"""Test upstream bridges' form field validator."""
|
||||||
validator = forms.bridges_validator
|
validator = forms.bridges_validator
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user