summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FSTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-04-15 11:16:07 (GMT)
committerSteven Knight <knight@baldmt.com>2005-04-15 11:16:07 (GMT)
commit1a7bfd1f408b60c477c78e725e3fbe88f5583975 (patch)
treec00ab860248c0d6aef62e2abe712486b96935307 /src/engine/SCons/Node/FSTests.py
parent2af8f3d9844711f25dd5c98d8be7096428ae9e9e (diff)
downloadSCons-1a7bfd1f408b60c477c78e725e3fbe88f5583975.zip
SCons-1a7bfd1f408b60c477c78e725e3fbe88f5583975.tar.gz
SCons-1a7bfd1f408b60c477c78e725e3fbe88f5583975.tar.bz2
Avoid must_be_a_Dir() attribute errors when trying to look up path names above the root directory in a file system (and speed things up a little bit), by making our RootDir class behave more like a real file system inode and getting rid of the ParentOfRoot class altogether.
Diffstat (limited to 'src/engine/SCons/Node/FSTests.py')
-rw-r--r--src/engine/SCons/Node/FSTests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 22882d8..935f0a2 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -1185,6 +1185,17 @@ class FSTestCase(_tempdirTestCase):
t = z.target_from_source('pre-', '-suf', lambda x: x[:-1])
assert str(t) == 'pre-z-suf', str(t)
+ def test_above_root(self):
+ """Testing looking up a path above the root directory"""
+ test = self.test
+ fs = self.fs
+
+ d1 = fs.Dir('d1')
+ d2 = d1.Dir('d2')
+ dirs = string.split(os.path.normpath(d2.abspath), os.sep)
+ above_path = apply(os.path.join, ['..']*len(dirs) + ['above'])
+ above = d2.Dir(above_path)
+
def test_rel_path(self):
"""Test the rel_path() method"""
test = self.test