From 6db1926a62bee229838fe3ff832c666114754d2b Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 9 Sep 2019 17:36:19 -0700 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- plinth/modules/tor/tests/test_tor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plinth/modules/tor/tests/test_tor.py b/plinth/modules/tor/tests/test_tor.py index 86985c352..1226f52af 100644 --- a/plinth/modules/tor/tests/test_tor.py +++ b/plinth/modules/tor/tests/test_tor.py @@ -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