Esempio n. 1
0
    def test_sbml_import(self):
        ## create sbml file for import
        sbml_filename = self.mod.to_sbml()
        assert os.path.isfile(sbml_filename)

        ## remove the existing copasi file
        if os.path.isfile(self.copasi_file1):
            os.remove(self.copasi_file1)

        ## import sbml
        mod = model.ImportSBML(sbml_filename).model
        self.assertTrue(type(mod) == model.Model)
Esempio n. 2
0
    def test_sbml_import_works(self):
        """
        Test that time course works after import
        :return:
        """
        ## create sbml file for import
        sbml_filename = self.mod.to_sbml()
        assert os.path.isfile(sbml_filename)

        ## remove the existing copasi file
        if os.path.isfile(self.copasi_file1):
            os.remove(self.copasi_file1)

        ## import sbml
        mod = model.ImportSBML(sbml_filename).model
        TC = tasks.TimeCourse(mod, end=100, intervals=100, step_size=1)
        plotted_time_course = viz.PlotTimeCourse(TC, savefig=True)
        self.assertEqual(
            2,
            len(
                glob.glob(
                    os.path.join(plotted_time_course.results_directory, '*'))))