summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FSTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-09-09 03:31:10 (GMT)
committerSteven Knight <knight@baldmt.com>2002-09-09 03:31:10 (GMT)
commitb18c0d85f90d17412960c39a9c935af9796a8cea (patch)
tree1dc031738458c71e519198d503a32d86a64eac2b /src/engine/SCons/Node/FSTests.py
parent596f9fa6bed4777348f005fb98f8b67dda93b515 (diff)
downloadSCons-b18c0d85f90d17412960c39a9c935af9796a8cea.zip
SCons-b18c0d85f90d17412960c39a9c935af9796a8cea.tar.gz
SCons-b18c0d85f90d17412960c39a9c935af9796a8cea.tar.bz2
Warn when -c can't remove a file.
Diffstat (limited to 'src/engine/SCons/Node/FSTests.py')
-rw-r--r--src/engine/SCons/Node/FSTests.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index f87abe7..adcccae 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -583,6 +583,35 @@ class FSTestCase(unittest.TestCase):
# XXX test current()
+ d = fs.Dir('dir')
+ r = d.remove()
+ assert r is None, r
+
+ f = fs.File('does_not_exist')
+ r = f.remove()
+ assert r == None, r
+
+ test.write('exists', "exists\n")
+ f = fs.File('exists')
+ r = f.remove()
+ assert r, r
+
+ test.write('can_not_remove', "can_not_remove\n")
+ test.writable(test.workpath('.'), 0)
+ fp = open(test.workpath('can_not_remove'))
+
+ f = fs.File('can_not_remove')
+ exc_caught = 0
+ try:
+ r = f.remove()
+ except OSError:
+ exc_caught = 1
+
+ fp.close()
+
+ assert exc_caught, "Should have caught an OSError, r = " + str(r)
+
+
class RepositoryTestCase(unittest.TestCase):
def runTest(self):
"""Test FS (file system) Repository operations