From ef3607cac7764df758769b1c7efad783ce52d222 Mon Sep 17 00:00:00 2001
From: VIGNET Pierre <pierre.vignet@irisa.fr>
Date: Fri, 13 Dec 2019 03:24:35 +0100
Subject: [PATCH] [lib] Tests: restore for PID/bcx files

---
 .../clause_constraints/mcl/TestMCLAnalyser.py | 36 +++++++++----------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/library/cadbiom/models/clause_constraints/mcl/TestMCLAnalyser.py b/library/cadbiom/models/clause_constraints/mcl/TestMCLAnalyser.py
index fe2e646..85bf78f 100644
--- a/library/cadbiom/models/clause_constraints/mcl/TestMCLAnalyser.py
+++ b/library/cadbiom/models/clause_constraints/mcl/TestMCLAnalyser.py
@@ -109,9 +109,7 @@ class ErrorRep(object):
 
 
 class TestMCLAnaLyzer(unittest.TestCase):
-    """
-    Unit tests for MCLAnalyser
-    """
+    """Unit tests for MCLAnalyser class"""
 
     def test_lit_sol_equal(self):
         """
@@ -139,21 +137,20 @@ class TestMCLAnaLyzer(unittest.TestCase):
         res = lit_sol_equal(sol1, sol2)
         self.assert_(not res, 'Error in lit_sol inequality: number case')
 
-    @unittest.skip("Test files not provided")
     def test_load1(self):
-        """
-        Load from a bcx file
-        """
+        """Load from a bcx file"""
         rep = ErrorRep()
         mcla = MCLAnalyser(rep)
-        mcla.build_from_chart_file("../ucl/examples/test_tgfb_ref_300511.bcx")
+        filename = pkg_resources.resource_filename(
+            __name__, # package name
+            "examples/delay1.bcx"
+        )
+        mcla.build_from_chart_file(filename)
         res = rep.error
-        self.assert_(not res, 'Error in load1')
+        self.assert_(not res, "Error during the load of bcx file")
 
     def test_load2(self):
-        """
-        Load from a cadlang file
-        """
+        """Load from a cadlang file"""
         rep = ErrorRep()
         mcla = MCLAnalyser(rep)
         filename = pkg_resources.resource_filename(
@@ -162,18 +159,19 @@ class TestMCLAnaLyzer(unittest.TestCase):
         )
         mcla.build_from_cadlang(filename)
         res = rep.error
-        self.assert_(not res, 'Error in load2')
+        self.assert_(not res, "Error during the load of cadlang file")
 
-    @unittest.skip("Test files not provided")
     def test_load3(self):
-        """
-        Load from a PID file
-        """
+        """Load from a PID file"""
         rep = ErrorRep()
         mcla = MCLAnalyser(rep)
-        mcla.build_from_pid_file("../ucl/examples/test_plk3_pathway.xml")
+        filename = pkg_resources.resource_filename(
+            __name__, # package name
+            "../../guard_transitions/translators/tests/tgf_cano.xml"
+        )
+        mcla.build_from_pid_file(filename)
         res = rep.error
-        self.assert_(not res, 'Error in load3')
+        self.assert_(not res, "during the load of PID xml file")
 
     def test_delay1(self):
         """
-- 
GitLab