mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-22 11:59:33 +00:00
tor: Make a utility method public
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
3d38b8a686
commit
2565737f38
@ -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):
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user