mass.test

Module containing functions for testing various mass methods.

There is the test_all() function to run all tests. Note that the testing requirements must be installed (e.g. pytest) for this function to work.

There are also functions for viewing and loading pre-built example MassModel objects via the json or sbml submodules, as well as functions to view Escher maps that correspond to certain pre-defined models.

Package Contents

Functions

create_test_model(model_name, io=’json’)

Return a mass.MassModel for testing.

view_test_models()

Print the test models that can be loaded.

view_test_maps()

Print the test models that can be loaded.

test_all(args=None)

Alias for running all unit-tests on installed mass.

mass.test.FILE_EXTENSIONS = ['.xml', '.json'][source]

list of recognized file extensions.

Type

list

mass.test.MASS_DIR[source]

The directory location of where mass is installed.

Type

str

mass.test.DATA_DIR[source]

The directory location of the test data model files and maps.

Type

str

mass.test.MODELS_DIR[source]

The directory location of the pre-built MassModel files.

Type

str

mass.test.MAPS_DIR[source]

The directory location of the pre-made escher maps files.

Type

str

mass.test.create_test_model(model_name, io='json')[source]

Return a mass.MassModel for testing.

Parameters
  • model_name (str) – The name of the test model to load. Valid model names can be printed and viewed using the view_test_models() function.

  • io (str {'sbml', 'json'}) – A string representing the mass.io module to use to load the model. Default is "sbml". Case sensitive.

Returns

The loaded MassModel

Return type

MassModel

mass.test.view_test_models()[source]

Print the test models that can be loaded.

mass.test.view_test_maps()[source]

Print the test models that can be loaded.

mass.test.test_all(args=None)[source]

Alias for running all unit-tests on installed mass.