mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +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.
|
||||
"""
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
@ -36,8 +38,9 @@ class TestTor:
|
||||
utils.is_apt_transport_tor_enabled()
|
||||
|
||||
@staticmethod
|
||||
@patch('plinth.modules.tor.app')
|
||||
@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.
|
||||
|
||||
This should work regardless of whether tor is installed, or
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user