test Package

test Package

cobra.test.create_test_model(test_pickle='/Users/danie/opencobra/python/cobra/test/data/salmonella.pickle')[source]

Returns a cobra model for testing. The default model is the up to date version of the Salmonella enterica Typhimurium LT2 model published in Thiele et al. 2011 BMC Sys Bio 5:8

test_pickle: The complete file name of a pickled cobra.Model or SBML XML file to be read. We currently provide Salmonella enterica Typhimurium and Escherichia coli models whose paths are stored in cobra.test.salmonella_pickle and cobra.test.ecoli_pickle, respectively. The ecoli model is a variant of the model published in Orth et al. 2011 Mol Syst Biol 7:535

cobra.test.create_test_suite()[source]

create a unittest.TestSuite with available tests

cobra.test.test_all()[source]

###running unit tests on cobra py###

flux_analysis Module

class cobra.test.flux_analysis.TestCobraFluxAnalysis(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test the simulation functions in cobra.flux_analysis

TODO: Add in tests for: MOMA

setUp()[source]
test_double_deletion()[source]
test_flux_variability()[source]
test_single_deletion()[source]
cobra.test.flux_analysis.test_all()[source]

parallel Module

Future test suite for parallel features

solvers Module

class cobra.test.solvers.TestCobraSolver(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]
test_glpk_attributes()
test_glpk_create()
test_glpk_feasible_solve()
test_glpk_independent_creation()
test_glpk_infeasible_solve()
test_glpk_solve_minimize()
test_glpk_solve_mip()
cobra.test.solvers.add_legacy_test(TestCobraSolver, solver_name, solver_function)[source]

Creates a test set for each of the installed solvers using the legacy interface.

cobra.test.solvers.add_new_test(TestCobraSolver, solver_name, solver)[source]

Creates a test set for each of the solvers that are installed using the modular interface.

cobra.test.solvers.add_test(TestCobraSolver, solver_name, solver)

Creates a test set for each of the solvers that are installed using the modular interface.

cobra.test.solvers.test_all()[source]

unit_tests Module

class cobra.test.unit_tests.CobraTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]
class cobra.test.unit_tests.TestCobraCore(methodName='runTest')[source]

Bases: cobra.test.unit_tests.CobraTestCase

test core cobra functions

test_add_reaction()[source]

test adding and deleting reactions

test_copy()[source]

modifying copy should not modify the original

class cobra.test.unit_tests.TestCobraIO(methodName='runTest')[source]

Bases: cobra.test.unit_tests.CobraTestCase

save_matlab_model(model, file_name)

Save the cobra model as a .mat file.

This .mat file can be used directly in the MATLAB version of COBRA. .. note:: This function works best with scipy 0.11b1 or later

model : cobra.Model file_name : str or file-like object

test_mat_read_write()[source]
class cobra.test.unit_tests.TestDictList(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]
testAdd()[source]
testAppend()[source]
testExtend()[source]
testIadd()[source]
cobra.test.unit_tests.test_all()[source]

Table Of Contents

Previous topic

stats Package

Next topic

topology Package

This Page