Commit efeb9740 authored by Thierry Martinez's avatar Thierry Martinez

Tests for reaction graphs

parent 04b8693a
:- use_module(library(plunit)).
:- begin_tests(reaction_graphs).
test(
'reaction_graph',
[true((
Edges == ['A' -> 'reaction0', 'reaction0' -> 'B'],
Reversible == yes,
Stochiometry == 2,
Kinetics == 'MA'(3)
))]
) :-
clear_model,
add_reaction('MA'(3) for 'A' <=> 2 * 'B'),
reaction_graph,
get_current_graph(GraphId),
all_items([parent: GraphId, kind: edge], Edges),
once(get_attribute('reaction0', reversible: Reversible)),
once(get_attribute('reaction0', kinetics: Kinetics)),
once(get_attribute(('reaction0' -> 'B'), stochiometry: Stochiometry)).
test(
'import_reactions_from_graph',
[true(Reactions == [ a <=[b]=> c, 'MA'(2) for a + 3 * c => 2 * d ])]
) :-
clear_model,
new_graph,
command(transition('reaction0')),
command(set_attribute('reaction0', reversible: yes)),
command(
add_edge(
'a' -> 'reaction0',
'b' -> 'reaction0',
'reaction0' -> 'b',
'reaction0' -> 'c',
'a' -> 'reaction1'
)
),
command(set_attribute('reaction1', kinetics: 'MA'(2))),
command(set_attribute(('c' -> 'reaction1'), stochiometry: 3)),
command(set_attribute(('reaction1' -> 'd'), stochiometry: 2)),
import_reactions_from_graph,
all_items([kind: reaction], Reactions).
:- end_tests(reaction_graphs).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment