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.
build_dynamical_system
(model, reporter)[source]¶ Build a dynamic system based on a given chart model
This function is fully inspired from MCLAnalyser class.
Parameters: - model (<ChartModel>) – Chart model loaded from file
- reporter (<Reporter>) – Error reporter (check error attr to search if errors occured)
Returns: Dynamic system with tab_symb attr initialized. This attr is mandatory to parse logical conditions in real conditions.
Return type: <CLDynSys>
-
tests.test_cases.
clean_test_env
(dir)[source]¶ Try to remove previous model & pickle file if they exist.
-
tests.test_cases.
fixture_me
(*args, **kwargs)[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
(*params)¶ Build model without valid transitions: raise an AssertionError
-
tests.test_cases.
get_default_blocks
(item)[source]¶ Return only right elements (conditions) of SigWhenExpr objects
We decompile SigDefaultExpr objects until we get SigWhenExpr objects. Names of events (left elements of SigWhenExpr objects) are not interesting here.
Parameters: item (<SigExpression> (and its subtypes)) – Boolean expression
-
tests.test_cases.
get_events_transitions
(model_path)[source]¶ Get sets of events and transitions from the given model
Note
We are not interested in simple events (for the moment…); because the naming of events is not fixed in time. => only events with conditions are kept.
Parameters: model_path (<str>) – Path of the model file (.bcx file). Returns: 2 sets: (events, transitions) Return type: <tuple <set>, <set>>
-
tests.test_cases.
t_bad_model
(model_name, *params)[source]¶ Build model without valid transitions: raise an AssertionError
-
tests.test_cases.
t_model
(model_name, *args)[source]¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_cavia
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_cricetulus
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_cricetulusWithoutSmallMolecules
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_crithidia
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_escherichia
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_homarus
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_mycobacterium
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_test_control_1
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_test_control_2
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_triticum
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_vigna
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase1
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase10
(*params)¶ Build model without valid transitions: raise an AssertionError
-
tests.test_cases.
test_virtualCase10b
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase10c
(*params)¶ Build model without valid transitions: raise an AssertionError
-
tests.test_cases.
test_virtualCase11
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase14
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase14b
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase14c
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase17
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase18
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase19
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase1_2b
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase2
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase20
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase3
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase4
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase5
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase6
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase6a
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase6b
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase7
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase8
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase9
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
-
tests.test_cases.
test_virtualCase9b
(*args)¶ Build model & check it vs a reference model.
A fail of isomorphic test means that the set of nodes or the set of transitions is different than expected.
A fail in the comparison of events or conditions means that the logical rules are different than expected.
Please note that a comparison of events may fail while the isomorphic test doesn’t. This may be due to variations in the writing of the formulas.
Ex: These two sequences are identical:
- ((_h_1_3) when ())
- ((_h_1_3))
… but the first one generates an excess object <SigConstExpr True> for the empty when expression.
Please also note that events are compared one by one; whereas conditions are compared accross the entire model.
Parameters: - model_name (<str>) – Reference model filename
- uris (<list>) – Uris of graphs
- blacklist_file (<str>) –
- convert_full_graph (<boolean>) – If True, we decompose entities in classes even if they are not involved elsewhere.
Key numeric_compartments: If True, names of compartments will be replaced by numbers.
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
(*args, **kwargs)[source]¶ Generate nested complexes, complexes/classes and classes classes: A (complex), C (protein), D (protein)
A: A1/A2 Complex/class
A1: X Complex
A2: B Complex
B: C,D Complex
- C: C1/C2 Class Protein
- D: D1/D2/D3 Class Protein
-
tests.test_functions.
simulated_physical_entities
(*args, **kwargs)[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;