From 0b43a12530f95de8e1d33150d926cdca4029f78f Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Sat, 19 Dec 2020 23:16:16 -0800 Subject: [PATCH] Small syntax and formatting cleanup * Avoid multiple lines when possible * Avoid creating variables for single use Signed-off-by: Eric Brown --- tests/functional/test_functional.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/functional/test_functional.py b/tests/functional/test_functional.py index 04b0ed5a..2d17e4e8 100644 --- a/tests/functional/test_functional.py +++ b/tests/functional/test_functional.py @@ -149,13 +149,11 @@ def test_mark_safe(self): def test_exec(self): '''Test the `exec` example.''' - filename = 'exec.py' expect = { 'SEVERITY': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 1, 'HIGH': 0}, - 'CONFIDENCE': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 0, - 'HIGH': 1} + 'CONFIDENCE': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 0, 'HIGH': 1} } - self.check_example(filename, expect) + self.check_example('exec.py', expect) def test_hardcoded_passwords(self): '''Test for hard-coded passwords.''' @@ -276,12 +274,11 @@ def test_subdirectory_okay(self): def test_os_chmod(self): '''Test setting file permissions.''' - filename = 'os-chmod.py' expect = { 'SEVERITY': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 2, 'HIGH': 8}, 'CONFIDENCE': {'UNDEFINED': 0, 'LOW': 0, 'MEDIUM': 1, 'HIGH': 9} } - self.check_example(filename, expect) + self.check_example('os-chmod.py', expect) def test_os_exec(self): '''Test for `os.exec*`.'''