diff options
Diffstat (limited to 'src/engine/SCons/EnvironmentTests.py')
-rw-r--r-- | src/engine/SCons/EnvironmentTests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 0d0d7da..ff89424 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -683,6 +683,19 @@ class EnvironmentTestCase(unittest.TestCase): assert env['TOOL2'] == 222, env assert env['AAA'] == 'aaa', env + def test_get(self): + """Test the get() method.""" + env = Environment(aaa = 'AAA') + + x = env.get('aaa') + assert x == 'AAA', x + x = env.get('aaa', 'XXX') + assert x == 'AAA', x + x = env.get('bbb') + assert x is None, x + x = env.get('bbb', 'XXX') + assert x == 'XXX', x + if __name__ == "__main__": suite = unittest.makeSuite(EnvironmentTestCase, 'test_') if not unittest.TextTestRunner().run(suite).wasSuccessful(): |