diff options
| author | Steven Knight <knight@baldmt.com> | 2003-04-12 10:52:50 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2003-04-12 10:52:50 (GMT) |
| commit | 5e229b4f577acd2a89196c74196997d2a6f017cc (patch) | |
| tree | faf99f3ad74bbc39c45e4897f94318afea0a11a8 /src/engine/SCons/Node/FSTests.py | |
| parent | 864888601110b99b76ed83958bc370b12d3656ad (diff) | |
| download | SCons-5e229b4f577acd2a89196c74196997d2a6f017cc.zip SCons-5e229b4f577acd2a89196c74196997d2a6f017cc.tar.gz SCons-5e229b4f577acd2a89196c74196997d2a6f017cc.tar.bz2 | |
Add a clear() method to reset a Node's state for re-processing.
Diffstat (limited to 'src/engine/SCons/Node/FSTests.py')
| -rw-r--r-- | src/engine/SCons/Node/FSTests.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 7836a13..b932896 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -1461,6 +1461,31 @@ class CacheDirTestCase(unittest.TestCase): SCons.Warnings.warningAsException(old_warn_exceptions) SCons.Warnings.suppressWarningClass(SCons.Warnings.CacheWriteErrorWarning) +class clearTestCase(unittest.TestCase): + def runTest(self): + fs = SCons.Node.FS.FS() + + e = fs.Entry('e') + e._exists = 1 + e._rexists = 1 + e.clear() + assert not hasattr(e, '_exists') + assert not hasattr(e, '_rexists') + + d = fs.Dir('d') + d._exists = 1 + d._rexists = 1 + d.clear() + assert not hasattr(d, '_exists') + assert not hasattr(d, '_rexists') + + f = fs.File('f') + f._exists = 1 + f._rexists = 1 + f.clear() + assert not hasattr(f, '_exists') + assert not hasattr(f, '_rexists') + if __name__ == "__main__": @@ -1475,5 +1500,6 @@ if __name__ == "__main__": suite.addTest(get_actionsTestCase()) suite.addTest(SConstruct_dirTestCase()) suite.addTest(CacheDirTestCase()) + suite.addTest(clearTestCase()) if not unittest.TextTestRunner().run(suite).wasSuccessful(): sys.exit(1) |
