From 2565737f38590893853c65247f0f39a71f474330 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 4 Feb 2019 15:49:24 -0800 Subject: [PATCH] tor: Make a utility method public Signed-off-by: Sunil Mohan Adapa --- plinth/modules/tor/tests/test_tor.py | 8 ++++---- plinth/modules/tor/utils.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plinth/modules/tor/tests/test_tor.py b/plinth/modules/tor/tests/test_tor.py index c7f16cbce..8782ec514 100644 --- a/plinth/modules/tor/tests/test_tor.py +++ b/plinth/modules/tor/tests/test_tor.py @@ -19,12 +19,12 @@ Tests for Tor module. """ -from django.core.exceptions import ValidationError import os import unittest -from plinth.modules.tor import utils -from plinth.modules.tor import forms +from django.core.exceptions import ValidationError + +from plinth.modules.tor import forms, utils euid = os.geteuid() @@ -36,7 +36,7 @@ class TestTor(unittest.TestCase): """Test that is_apt_transport_tor_enabled does not raise any unhandled exceptions. """ - utils._is_apt_transport_tor_enabled() + utils.is_apt_transport_tor_enabled() @unittest.skipUnless(euid == 0, 'Needs to be root') def test_get_status(self): diff --git a/plinth/modules/tor/utils.py b/plinth/modules/tor/utils.py index d2fe247b0..a87ffad4d 100644 --- a/plinth/modules/tor/utils.py +++ b/plinth/modules/tor/utils.py @@ -75,7 +75,7 @@ def get_status(): 'hs_ports': hs_info['ports'], 'hs_services': hs_services, 'apt_transport_tor_enabled': - _is_apt_transport_tor_enabled() + is_apt_transport_tor_enabled() } @@ -133,7 +133,7 @@ def get_augeas(): return aug -def _is_apt_transport_tor_enabled(): +def is_apt_transport_tor_enabled(): """Return whether APT is set to download packages over Tor.""" try: aug = get_augeas()