Documentation of tests for developers

Cases

This module is used to translate Biopax test cases to cadbiom models and compare them with the cadbiom model reference (if it exists).

Note

To add a test, please add it to test_pool dictionnary. key: name of the test, value: tuple of a list of uris and path to a potential blacklist file.

tests.test_cases.clean_test_env(dir)[source]

Try to remove previous model & pickle file if they exist.

tests.test_cases.fixture_me()[source]

Fixture that is launched before and after all tests.

Note

autouse allows to launch the fixture without explicitly noting it.

tests.test_cases.func()

Build model without valid transitions that raise AssertionError

tests.test_cases.t_bad_model(model_name, uris, blacklist_file, convertFullGraph)[source]

Build model without valid transitions that raise AssertionError

tests.test_cases.t_model(model_name, uris, blacklist_file, convertFullGraph)[source]

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_cavia()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_cricetulus()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_cricetulusWithoutSmallMolecules()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_crithidia()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_escherichia()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_homarus()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_mycobacterium()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_triticum()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_vigna()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase1()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase10()

Build model without valid transitions that raise AssertionError

tests.test_cases.test_virtualCase10b()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase10c()

Build model without valid transitions that raise AssertionError

tests.test_cases.test_virtualCase11()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase17()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase18()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase19()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase1_2b()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase2()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase3()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase4()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase5()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase6()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase6a()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase6b()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase7()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase8()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase9()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

tests.test_cases.test_virtualCase9b()

Build model & check it vs a reference model.

Note

convertFullGraph = True: We decompose entities in classes even if they are not involved elsewhere.

Queries

This module is used to test BioPAX SPARQL queries.

Note

To add a test, please add it to test_pool and result_pool dictionnaries. key: name of the test, value: tuple of uris or expected result.

tests.test_queries.func()

Test if queried modifications features are similar to expected ones.

tests.test_queries.t_modification_features(model_name, uris, expected_result)[source]

Test if queried modifications features are similar to expected ones.

tests.test_queries.test_virtualCase7()

Test if queried modifications features are similar to expected ones.

tests.test_queries.test_virtualCase8()

Test if queried modifications features are similar to expected ones.

tests.test_queries.test_xrefs_query()[source]

Test the retrieving of xrefs of all entities in the database

Entities that have xref attributes in addition to their entityReference xrefs are supported.

UnificationXref, RelationshipXref are supported.

Classes inherit xref from their members via their entityReference attributes that have memberEntityReference attributes.

Functions

This module is used to test functions used during the translation of Biopax content to cadbiom model.

tests.test_functions.classes_and_classes_complexes()[source]

Generate nested complexes, complexes/classes and classes classes: A (complex), C (protein), D (protein)

A: A1/A2

A1: X A2: B

B: C,D
C: C1/C2 D: D1/D2/D3
tests.test_functions.get_classes_from_reactants(primitives, dictPhysicalEntity)[source]

Recursively get primitives that are classes from the given standard primitives

tests.test_functions.simulated_physical_entities()[source]

Provides simulated entities for merge tests

A: Standard Complex with 2 components: X, Y Abis: A copy of A with another uri: must be merged together. Ater: A copy of A but with another uri and a different component: is unique,

must be kept.
tests.test_functions.test_get_classes_from_reactants(classes_and_classes_complexes)[source]

Test the recursive search of classes in a set of primitives primitives are reactants of a reaction.

get_classes_from_reactants() must return the classes in each reactant ordered according to their order of intrication

tests.test_functions.test_merge_entities(simulated_physical_entities)[source]

Test the merge of similar entities

tests.test_functions.test_sort_of_entities(simulated_physical_entities)[source]

Test the sort of entities that is used as a result for the merge

Note

The sort of all entities must respect lexicographic order of all attributes.

=> if component URI is not casted into a sorted list, the order is modified, and then, itertools.groupby will be fooled:

  • [‘W’, ‘X’] < [‘X’, ‘Y’] => True
  • {‘X’, ‘W’} < {‘X’, ‘Y’} => False
['W', 'X'] is < to ['X', 'Y']
Ater;A;['W', 'X'];http://simulated/test#anywhere;
A;A;['X', 'Y'];http://simulated/test#anywhere;
Abis;A;['X', 'Y'];http://simulated/test#anywhere;

If we do not cast set into list:
A;A;['Y', 'X'];http://simulated/test#anywhere;
Abis;A;['Y', 'X'];http://simulated/test#anywhere;
Ater;A;['X', 'W'];http://simulated/test#anywhere;