diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-04-22 18:18:09 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2019-04-22 18:18:09 (GMT) |
commit | 7f6e25d61599ba547008b4edba74cb46b8d43626 (patch) | |
tree | 9c530483c95bc0f43c07e77a4c7d19367d3f4fa4 /src/engine | |
parent | 1a98847cf341370f2bc9224d4e43ce62e679d74a (diff) | |
download | SCons-7f6e25d61599ba547008b4edba74cb46b8d43626.zip SCons-7f6e25d61599ba547008b4edba74cb46b8d43626.tar.gz SCons-7f6e25d61599ba547008b4edba74cb46b8d43626.tar.bz2 |
PEP 8 file
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Platform/PlatformTests.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/engine/SCons/Platform/PlatformTests.py b/src/engine/SCons/Platform/PlatformTests.py index 3f42eae..213c6f7 100644 --- a/src/engine/SCons/Platform/PlatformTests.py +++ b/src/engine/SCons/Platform/PlatformTests.py @@ -33,6 +33,7 @@ import SCons.Platform import SCons.Environment import SCons.Action + class Environment(collections.UserDict): def Detect(self, cmd): return cmd @@ -40,6 +41,7 @@ class Environment(collections.UserDict): def AppendENVPath(self, key, value): pass + class PlatformTestCase(unittest.TestCase): def test_Platform(self): """Test the Platform() function""" @@ -117,6 +119,7 @@ class PlatformTestCase(unittest.TestCase): SCons.Platform.Platform()(env) assert env != {}, env + class TempFileMungeTestCase(unittest.TestCase): def test_MAXLINELENGTH(self): """ Test different values for MAXLINELENGTH with the same @@ -138,18 +141,18 @@ class TempFileMungeTestCase(unittest.TestCase): env['OVERSIMPLIFIED'] = 'command' expanded_cmd = env.subst(defined_cmd) # Call the tempfile munger - cmd = t(None,None,env,0) + cmd = t(None, None, env, 0) assert cmd == defined_cmd, cmd # Let MAXLINELENGTH equal the string's length env['MAXLINELENGTH'] = len(expanded_cmd) - cmd = t(None,None,env,0) + cmd = t(None, None, env, 0) assert cmd == defined_cmd, cmd # Finally, let the actual tempfile mechanism kick in # Disable printing of actions... old_actions = SCons.Action.print_actions SCons.Action.print_actions = 0 env['MAXLINELENGTH'] = len(expanded_cmd)-1 - cmd = t(None,None,env,0) + cmd = t(None, None, env, 0) # ...and restoring its setting. SCons.Action.print_actions = old_actions assert cmd != defined_cmd, cmd @@ -173,9 +176,11 @@ class TempFileMungeTestCase(unittest.TestCase): old_actions = SCons.Action.print_actions SCons.Action.print_actions = 0 # Create an instance of object derived class to allow setattrb - class Node(object) : + + class Node(object): class Attrs(object): pass + def __init__(self): self.attributes = self.Attrs() target = [Node()] @@ -185,6 +190,7 @@ class TempFileMungeTestCase(unittest.TestCase): assert cmd != defined_cmd, cmd assert cmd == getattr(target[0].attributes, 'tempfile_cmdlist', None) + class PlatformEscapeTestCase(unittest.TestCase): def test_posix_escape(self): """ Check that paths with parens are escaped properly |