fix topology files relative paths in PCE functest
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test_pce.py
index 5375dabc7e75c216f305ef20e29e6b7808627842..61f3b2ab63357da633a990d61d53ecbc878fae76 100644 (file)
@@ -30,15 +30,18 @@ class TransportPCEtesting(unittest.TestCase):
 
     @classmethod
     def _get_file(cls):
-        topo_bi_dir_file = "sample_configs/honeynode-topo.xml"
+        topo_bi_dir_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                                        "..", "..", "sample_configs", "honeynode-topo.xml")
         if os.path.isfile(topo_bi_dir_file):
             with open(topo_bi_dir_file, 'r') as topo_bi_dir:
                 cls.simple_topo_bi_dir_data = topo_bi_dir.read()
-        topo_uni_dir_file = "sample_configs/NW-simple-topology.xml"
+        topo_uni_dir_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                                         "..", "..", "sample_configs", "NW-simple-topology.xml")
         if os.path.isfile(topo_uni_dir_file):
             with open(topo_uni_dir_file, 'r') as topo_uni_dir:
                 cls.simple_topo_uni_dir_data = topo_uni_dir.read()
-        topo_uni_dir_complex_file = "sample_configs/NW-for-test-5-4.xml"
+        topo_uni_dir_complex_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                                                 "..", "..", "sample_configs", "NW-for-test-5-4.xml")
         if os.path.isfile(topo_uni_dir_complex_file):
             with open(topo_uni_dir_complex_file, 'r') as topo_uni_dir_complex:
                 cls.complex_topo_uni_dir_data = topo_uni_dir_complex.read()