summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FSTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-10-07 23:50:06 (GMT)
committerSteven Knight <knight@baldmt.com>2002-10-07 23:50:06 (GMT)
commitbbdf3e20a90dabfe9944bfc58e6756cf799df7e9 (patch)
tree6bfa44d8dd2407ce2973a3b688860629accc0e50 /src/engine/SCons/Node/FSTests.py
parentbdf39335f8eff310c749fa5a9d08697aa81a003b (diff)
downloadSCons-bbdf3e20a90dabfe9944bfc58e6756cf799df7e9.zip
SCons-bbdf3e20a90dabfe9944bfc58e6756cf799df7e9.tar.gz
SCons-bbdf3e20a90dabfe9944bfc58e6756cf799df7e9.tar.bz2
Get rid of the magicness of the magic _ variables. (Anthony Roach)
Diffstat (limited to 'src/engine/SCons/Node/FSTests.py')
-rw-r--r--src/engine/SCons/Node/FSTests.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 1d8b0eb..51d4a6f 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -214,6 +214,41 @@ class FSTestCase(unittest.TestCase):
assert f1.path == d1_f1, "f1.path %s != %s" % (f1.path, d1_f1)
assert str(f1) == d1_f1, "str(f1) %s != %s" % (str(f1), d1_f1)
+ x1 = d1.File('x1')
+ assert str(x1) == os.path.join('d1', 'x1')
+
+ x2 = d1.Dir('x2')
+ assert str(x2) == os.path.join('d1', 'x2')
+
+ assert d1.File(x1) == x1
+ assert d1.Dir(x2) == x2
+
+ x1.cwd = d1
+
+ x3 = x1.File('x3')
+ assert str(x3) == os.path.join('d1', 'x3')
+
+ x4 = x1.Dir('x4')
+ assert str(x4) == os.path.join('d1', 'x4')
+
+ assert x1.File(x3) == x3
+ assert x1.Dir(x4) == x4
+
+ try:
+ x1.File(x4)
+ except TypeError:
+ pass
+ else:
+ assert 0
+
+ try:
+ x1.Dir(x3)
+ except TypeError:
+ pass
+ else:
+ assert 0
+
+
seps = [os.sep]
if os.sep != '/':
seps = seps + ['/']