tests: Minor PEP8 fixes

This commit is contained in:
Sunil Mohan Adapa 2016-06-12 12:33:57 +05:30 committed by James Valleroy
parent 9ac37465dd
commit 7a5167e6bd
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 8 additions and 6 deletions

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

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'),