diff options
author | Steven Knight <knight@baldmt.com> | 2004-11-10 00:39:51 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-11-10 00:39:51 (GMT) |
commit | 81262f1b830ceb37dbec4ff39790876b55f0d2f7 (patch) | |
tree | c6de474d228ca2ba419e9296b9efd0c2a5ec8ea1 /src/engine/SCons/Node/NodeTests.py | |
parent | 4c0421f6c2210f908fdfb1686c473340b15d09c7 (diff) | |
download | SCons-81262f1b830ceb37dbec4ff39790876b55f0d2f7.zip SCons-81262f1b830ceb37dbec4ff39790876b55f0d2f7.tar.gz SCons-81262f1b830ceb37dbec4ff39790876b55f0d2f7.tar.bz2 |
Use a Node's environment in preference to the builder's environment.
Diffstat (limited to 'src/engine/SCons/Node/NodeTests.py')
-rw-r--r-- | src/engine/SCons/Node/NodeTests.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index 508b70e..e7d3061 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -288,6 +288,47 @@ class NodeTestCase(unittest.TestCase): assert str(act.built_target[0]) == "xxx", str(act.built_target[0]) assert act.built_source == ["yyy", "zzz"], act.built_source + def test_get_executor(self): + """Test the reset_executor() method""" + n = SCons.Node.Node() + + try: + n.get_executor(0) + except AttributeError: + pass + else: + self.fail("did not catch expected AttributeError") + + class Builder: + action = 'act' + env = 'env1' + overrides = {} + + n = SCons.Node.Node() + n.builder_set(Builder()) + x = n.get_executor() + assert x.env == 'env1', x.env + + n = SCons.Node.Node() + n.builder_set(Builder()) + n.env_set('env2') + x = n.get_executor() + assert x.env == 'env2', x.env + + def test_set_executor(self): + """Test the reset_executor() method""" + n = SCons.Node.Node() + n.set_executor(1) + assert n.executor == 1, n.executor + + def test_reset_executor(self): + """Test the reset_executor() method""" + n = SCons.Node.Node() + n.set_executor(1) + assert n.executor == 1, n.executor + n.reset_executor() + assert not hasattr(n, 'executor'), "unexpected executor attribute" + def test_built(self): """Test the built() method""" class SubNode(SCons.Node.Node): |