tests: Minor PEP8 fixes

This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2016-06-19 16:20:07 -04:00
1 parent 9ac37465dd
commit 7a5167e6bd
2 files changed
+8 -6

No files matched your search

+3 -2
View File
@@ -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()
+5 -4
View File
@@ -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'),