# Lookup the directory
for orig, norm in map(None, path_orig, path_norm):
try:
- directory = directory.entries[norm]
+ entries = directory.entries
+ except AttributeError:
+ # We tried to look up the entry in either an Entry or
+ # a File. Give whatever it is a chance to do what's
+ # appropriate: morph into a Dir or raise an exception.
+ directory.must_be_a_Dir()
+ entries = directory.entries
+ try:
+ directory = entries[norm]
except KeyError:
if not create:
raise SCons.Errors.UserError
directory.entries[norm] = d
directory.add_wkid(d)
directory = d
- except AttributeError:
- # We tried to look up the entry in either an Entry or
- # a File. Give whatever it is a chance to do what's
- # appropriate: morph into a Dir or raise an exception.
- directory.must_be_a_Dir()
- directory = directory.entries[norm]
directory.must_be_a_Dir()
r = sub.file_on_disk('dir')
assert not r, r
-class EntryTestCase(unittest.TestCase):
- def runTest(self):
+class EntryTestCase(_tempdirTestCase):
+ def test_runTest(self):
"""Test methods specific to the Entry sub-class.
"""
test = TestCmd(workdir='')
# Doesn't exist, no sources, and no builder: no sig
assert sig is None, sig
-
+ def test_Entry_Entry_lookup(self):
+ """Test looking up an Entry within another Entry"""
+ self.fs.Entry('#topdir')
+ self.fs.Entry('#topdir/a/b/c')
class RepositoryTestCase(_tempdirTestCase):
if __name__ == "__main__":
suite = unittest.TestSuite()
suite.addTest(BuildDirTestCase())
- suite.addTest(EntryTestCase())
suite.addTest(find_fileTestCase())
suite.addTest(StringDirTestCase())
suite.addTest(stored_infoTestCase())
tclasses = [
BaseTestCase,
BuildInfoTestCase,
+ EntryTestCase,
NodeInfoTestCase,
FSTestCase,
DirTestCase,