mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
tor: Fix test case for getting status
Mock the app so that it doesn't have to be loaded. Closes: #1645. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
54b0e7c63b
commit
6db1926a62
@ -18,6 +18,8 @@
|
|||||||
Tests for Tor module.
|
Tests for Tor module.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
@ -36,8 +38,9 @@ class TestTor:
|
|||||||
utils.is_apt_transport_tor_enabled()
|
utils.is_apt_transport_tor_enabled()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@patch('plinth.modules.tor.app')
|
||||||
@pytest.mark.usefixtures('needs_root', 'load_cfg')
|
@pytest.mark.usefixtures('needs_root', 'load_cfg')
|
||||||
def test_get_status():
|
def test_get_status(_app):
|
||||||
"""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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user