示例#1
0
 def testRun(self):
     model = load_sbml_model(SMALL_TEST_MODEL, kind=CONSTRAINT_BASED)
     fix_bigg_model(model)
     write_model_to_file(model, PLAIN_TEXT_COPY)
     model_copy = read_model_from_file(PLAIN_TEXT_COPY, kind=CONSTRAINT_BASED)
     solution = FBA(model_copy)
     self.assertEqual(solution.status, Status.OPTIMAL)
     self.assertAlmostEqual(solution.fobj, GROWTH_RATE, places=2)
示例#2
0
 def testRun(self):
     model = load_sbml_model(SMALL_TEST_MODEL, kind=CONSTRAINT_BASED)
     write_model_to_file(model, PLAIN_TEXT_COPY)
     model_copy = read_model_from_file(PLAIN_TEXT_COPY, kind=CONSTRAINT_BASED)
     self.assertListEqual(sorted(model.metabolites.keys()),
                          sorted(model_copy.metabolites.keys()))
     self.assertListEqual(model.reactions.keys(), model_copy.reactions.keys())
     self.assertDictEqual(dict(model.stoichiometry),
                          dict(model_copy.stoichiometry))
     self.assertDictEqual(model.bounds, model_copy.bounds)