Skip to content

Commit

Permalink
chore: expanded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Aug 17, 2021
1 parent 5ee1ddc commit 7a803e9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,22 @@ def test_raise_if_simulation_error(self):
module_method_args = get_default_solver_module_function_args()

# optimal FBA solution
solution = mock.Mock(status='opt')
model = cbmpy.CBRead.readSBML3FBC(self.MODEL_FILENAME)
solution = cbmpy.CBGLPK.glpk_analyzeModel(model, return_lp_obj=True)
method_props['raise_if_simulation_error'](module_method_args, solution)

# infeasible FBA solution
solution.status = 'infeas'
model = cbmpy.CBRead.readSBML3FBC(self.MODEL_FILENAME)
for bound in model.flux_bounds:
bound.setValue(1000)
solution = cbmpy.CBGLPK.glpk_analyzeModel(model, return_lp_obj=True)
with self.assertRaisesRegex(ValueError, ''):
method_props['raise_if_simulation_error'](module_method_args, solution)

# FVA
method_props = KISAO_ALGORITHMS_PARAMETERS_MAP['KISAO_0000526']
method_props['raise_if_simulation_error'](None, None)

model = cbmpy.CBRead.readSBML3FBC(self.MODEL_FILENAME)
solution = cbmpy.CBGLPK.glpk_FluxVariabilityAnalysis(model)
method_props['raise_if_simulation_error'](module_method_args, solution)

0 comments on commit 7a803e9

Please sign in to comment.