mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
tests: Minor PEP8 fixes
This commit is contained in:
parent
9ac37465dd
commit
7a5167e6bd
@ -33,8 +33,8 @@ def run_tests(pattern=None, return_to_caller=False):
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = \
|
||||
'plinth.tests.data.django_test_settings'
|
||||
django.setup()
|
||||
TestRunner = get_runner(settings)
|
||||
test_runner = TestRunner()
|
||||
test_runner_cls = get_runner(settings)
|
||||
test_runner = test_runner_cls()
|
||||
|
||||
if pattern is None:
|
||||
pattern_list = [
|
||||
@ -48,5 +48,6 @@ def run_tests(pattern=None, return_to_caller=False):
|
||||
if failures > 0 or not return_to_caller:
|
||||
sys.exit(bool(failures))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run_tests()
|
||||
|
||||
@ -28,8 +28,8 @@ from plinth import cfg
|
||||
|
||||
|
||||
test_dir = os.path.split(__file__)[0]
|
||||
root_dir = os.path.abspath(os.path.join(test_dir, os.path.pardir + os.path.sep +
|
||||
os.path.pardir))
|
||||
root_dir = os.path.abspath(os.path.join(test_dir, os.path.pardir +
|
||||
os.path.sep + os.path.pardir))
|
||||
cfg.actions_dir = os.path.join(root_dir, 'actions')
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ class TestPrivileged(unittest.TestCase):
|
||||
def notest_run_as_root(self):
|
||||
"""1. Privileged actions run as root. """
|
||||
self.assertEqual(
|
||||
'0', # user 0 is root
|
||||
'0', # user 0 is root
|
||||
superuser_run('id', ['-ur'])[0].strip())
|
||||
|
||||
def test_breakout_actions_dir(self):
|
||||
@ -114,7 +114,8 @@ class TestPrivileged(unittest.TestCase):
|
||||
def test_breakout_option_list(self):
|
||||
"""3D. Option lists can't be used to run other actions.
|
||||
|
||||
Verify that shell control characters aren't interpreted in option lists.
|
||||
Verify that shell control characters aren't interpreted in
|
||||
option lists.
|
||||
"""
|
||||
option_lists = ((';', 'echo', 'hello'),
|
||||
('&&', 'echo', 'hello'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user