test Package — cobra 0.2.0 documentation

### Navigation

- index
- modules |
- next |
- previous |
- cobra 0.2.0 documentation »
- cobra Package »

# test Package

## `test` Package

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

  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`()

  create a unittest.TestSuite with available tests

`cobra.test.` `test_all`()

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

## `flux_analysis` Module

class `cobra.test.flux_analysis.` `TestCobraFluxAnalysis`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  Test the simulation functions in cobra.flux_analysis

  TODO: Add in tests for: MOMA

  `setUp`()
  `test_double_deletion`()
  `test_flux_variability`()
  `test_single_deletion`()

`cobra.test.flux_analysis.` `test_all`()

## `parallel` Module

Future test suite for parallel features

## `solvers` Module

class `cobra.test.solvers.` `TestCobraSolver`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()
  `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)

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

`cobra.test.solvers.` `add_new_test`(TestCobraSolver, solver_name, solver)

  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`()

## `unit_tests` Module

class `cobra.test.unit_tests.` `CobraTestCase`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()

class `cobra.test.unit_tests.` `TestCobraCore`(methodName='runTest')

  Bases: `cobra.test.unit_tests.CobraTestCase`

  test core cobra functions

  `test_add_reaction`()

    test adding and deleting reactions

  `test_copy`()

    modifying copy should not modify the original

class `cobra.test.unit_tests.` `TestCobraIO`(methodName='runTest')

  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`()

class `cobra.test.unit_tests.` `TestDictList`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()
  `testAdd`()
  `testAppend`()
  `testExtend`()
  `testIadd`()

`cobra.test.unit_tests.` `test_all`()

### Navigation

- index
- modules |
- next |
- previous |
- cobra 0.2.0 documentation »
- cobra Package »