# 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_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.simulated_physical_entities()[source]

Provides simulated entities for merge tests

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;