diff options
author | Steven Knight <knight@baldmt.com> | 2003-09-15 14:01:28 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-09-15 14:01:28 (GMT) |
commit | c41dc6daf69787a9f4d4984aec727af705445e46 (patch) | |
tree | 24ce63856445f3ab2b29f4593bd0cb886cd4f4ba /src/engine/SCons/EnvironmentTests.py | |
parent | f36ff530132ecfe7941f80d2d6e5f03f75decf41 (diff) | |
download | SCons-c41dc6daf69787a9f4d4984aec727af705445e46.zip SCons-c41dc6daf69787a9f4d4984aec727af705445e46.tar.gz SCons-c41dc6daf69787a9f4d4984aec727af705445e46.tar.bz2 |
Turn more global functions into Environment methods. (clone of 0.92.C121)
Diffstat (limited to 'src/engine/SCons/EnvironmentTests.py')
-rw-r--r-- | src/engine/SCons/EnvironmentTests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index aa5dbac..36f4112 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -1494,6 +1494,22 @@ class EnvironmentTestCase(unittest.TestCase): env.TargetSignatures('$C') assert env._build_signature == 0, env._build_signature + def test_Environment(type): + """Test setting Environment variable to an Environment.Base subclass""" + class MyEnv(SCons.Environment.Base): + def xxx(self, string): + return self.subst(string) + + SCons.Environment.Environment = MyEnv + + env = SCons.Environment.Environment(FOO = 'foo') + + f = env.subst('$FOO') + assert f == 'foo', f + + f = env.xxx('$FOO') + assert f == 'foo', f + if __name__ == "__main__": suite = unittest.makeSuite(EnvironmentTestCase, 'test_') |