tor: Make a utility method public

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2019-02-04 15:49:24 -08:00
parent 3d38b8a686
commit 2565737f38
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 6 additions and 6 deletions

View File

@ -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):

View File

@ -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()