summaryrefslogtreecommitdiff
path: root/meta/lib/oe/tests/test_path.py
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2013-02-11 20:21:52 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-11 22:44:55 +0000
commita96e2c84f24c15b77ee1fbc1f998b8b4796b8664 (patch)
tree3d48027ae8fd30c9da84cf7f4c498675ff1e9650 /meta/lib/oe/tests/test_path.py
parent579369b0fb27fad6d628746a50b9b798078500f6 (diff)
downloadopenembedded-core-a96e2c84f24c15b77ee1fbc1f998b8b4796b8664.tar.gz
openembedded-core-a96e2c84f24c15b77ee1fbc1f998b8b4796b8664.tar.bz2
openembedded-core-a96e2c84f24c15b77ee1fbc1f998b8b4796b8664.zip
lib/oe/path.py: support missing directory components in realpath()
Some use cases in OE operate on symlinks which dangling path components. Assume that these are directories instead of raising ENOENT. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/tests/test_path.py')
-rw-r--r--meta/lib/oe/tests/test_path.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oe/tests/test_path.py b/meta/lib/oe/tests/test_path.py
index e6aa601618..3d41ce157a 100644
--- a/meta/lib/oe/tests/test_path.py
+++ b/meta/lib/oe/tests/test_path.py
@@ -25,7 +25,7 @@ class TestRealPath(unittest.TestCase):
( "usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F" ),
( "loop", "a/loop", None ),
( "a/loop", "../loop", None ),
- ( "b/test", "file/foo", None ),
+ ( "b/test", "file/foo", "/b/file/foo" ),
]
LINKS_PHYS = [
@@ -59,8 +59,9 @@ class TestRealPath(unittest.TestCase):
for l in self.LINKS:
os.symlink(l[1], os.path.join(self.root, l[0]))
- def __realpath(self, file, use_physdir):
- return oe.path.realpath(os.path.join(self.root, file), self.root, use_physdir)
+ def __realpath(self, file, use_physdir, assume_dir = True):
+ return oe.path.realpath(os.path.join(self.root, file), self.root,
+ use_physdir, assume_dir = assume_dir)
def test_norm(self):
for l in self.LINKS:
@@ -85,5 +86,4 @@ class TestRealPath(unittest.TestCase):
def test_loop(self):
for e in self.EXCEPTIONS:
self.assertRaisesRegexp(OSError, r'\[Errno %u\]' % e[1],
- self.__realpath, e[0], False)
-
+ self.__realpath, e[0], False, False)