Skip to contentSkip to conversation

lib/layerindexlib/tests/cooker.py: Fix topdir to use an absolute (real) path

PATCH New Mark Hatle 1 participant 1 message Sep 25, 2018

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH v2 2/3 lib/layerindexlib/tests/cooker.py: Fix topdir to use an absolute (real) path

The test case needs to access test case files. Different versions of python may return absolute or relative locations in __file__. Use the same approach as other test cases in determining the location of the test files.

---
 lib/layerindexlib/tests/cooker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/layerindexlib/tests/cooker.py +1 -1
index 9ce6e8c..fdbf091 100644
@@ -32,7 +32,7 @@ class LayerIndexCookerTest(LayersTest):
         # configure the test data.  But we can emulate the basics of the layer.conf
         # files, so that is what we will do.
 
-        new_topdir = os.path.join(os.path.dirname(__file__), "testdata")
+        new_topdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "testdata")
         new_bbpath = os.path.join(new_topdir, "build")
 
         self.d.setVar('TOPDIR', new_topdir)
Signature · 1 line
1.8.3.1