Skip to content

Commit 1e29ef0

Browse files
committed
test: add bad BMA input files
1 parent eb5ef56 commit 1e29ef0

12 files changed

+333
-1
lines changed

test/qn_test.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,19 @@ end
145145
@testitem "Load from BMA" begin
146146
using JSON
147147
bma_models_path = joinpath(@__DIR__, "resources", "bma_models")
148+
good_models = joinpath(bma_models_path, "well_formed_examples")
148149

149-
for model_path in readdir(bma_models_path; join = true)
150+
for model_path in readdir(good_models; join = true)
150151
qn = QN(model_path)
151152
@test qn isa GraphDynamicalSystem
152153
end
154+
155+
bad_models = joinpath(bma_models_path, "error_examples")
156+
157+
@test_throws "Neither alternative" QN(joinpath(bad_models, "bad_edge_key.json"))
158+
@test_throws "Failed to add" QN(joinpath(bad_models, "duplicate_entity_ids.json"))
159+
@test_throws "Error while constructing name for entity" QN(
160+
joinpath(bad_models, "multiple_incoming_edges_same_name.json"),
161+
)
162+
153163
end
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"Layout": {
3+
"AnnotatedGridCells": [],
4+
"Containers": [
5+
{
6+
"Id": 1,
7+
"Name": "C0",
8+
"PositionX": 2,
9+
"PositionY": 0,
10+
"Size": 1
11+
}
12+
],
13+
"Description": "",
14+
"Variables": [
15+
{
16+
"Angle": 0,
17+
"CellX": null,
18+
"CellY": null,
19+
"ContainerId": 1,
20+
"Description": "",
21+
"Id": 1,
22+
"Name": "a",
23+
"PositionX": 630.7,
24+
"PositionY": 47.34285714285714,
25+
"Type": "Default"
26+
},
27+
{
28+
"Angle": 0,
29+
"CellX": null,
30+
"CellY": null,
31+
"ContainerId": 1,
32+
"Description": "",
33+
"Id": 2,
34+
"Name": "b",
35+
"PositionX": 583.2,
36+
"PositionY": 178.77142857142857,
37+
"Type": "Default"
38+
},
39+
{
40+
"Angle": 0,
41+
"CellX": null,
42+
"CellY": null,
43+
"ContainerId": 1,
44+
"Description": "",
45+
"Id": 3,
46+
"Name": "c",
47+
"PositionX": 678.2,
48+
"PositionY": 162.34285714285716,
49+
"Type": "Default"
50+
}
51+
]
52+
},
53+
"Model": {
54+
"Name": "ToyModelStable",
55+
"Relationships": [
56+
{
57+
"FromVariableError": 1,
58+
"Id": 1,
59+
"ToVariableError": 2,
60+
"Type": "Activator"
61+
},
62+
{
63+
"ErrorFromVariable": 2,
64+
"ErrorToVariable": 3,
65+
"Id": 2,
66+
"Type": "Activator"
67+
},
68+
{
69+
"FromErrorVariable": 3,
70+
"Id": 3,
71+
"ToErrorVariable": 1,
72+
"Type": "Inhibitor"
73+
}
74+
],
75+
"Variables": [
76+
{
77+
"Formula": "",
78+
"Id": 1,
79+
"Name": "a",
80+
"RangeFrom": 0,
81+
"RangeTo": 4
82+
},
83+
{
84+
"Formula": "",
85+
"Id": 2,
86+
"Name": "b",
87+
"RangeFrom": 0,
88+
"RangeTo": 4
89+
},
90+
{
91+
"Formula": "",
92+
"Id": 3,
93+
"Name": "c",
94+
"RangeFrom": 0,
95+
"RangeTo": 4
96+
}
97+
]
98+
},
99+
"ltl": {
100+
"operations": [],
101+
"states": []
102+
}
103+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"Layout": {
3+
"AnnotatedGridCells": [],
4+
"Containers": [
5+
{
6+
"Id": 1,
7+
"Name": "C0",
8+
"PositionX": 2,
9+
"PositionY": 0,
10+
"Size": 1
11+
}
12+
],
13+
"Description": "",
14+
"Variables": [
15+
{
16+
"Angle": 0,
17+
"CellX": null,
18+
"CellY": null,
19+
"ContainerId": 1,
20+
"Description": "",
21+
"Id": 1,
22+
"Name": "a",
23+
"PositionX": 630.7,
24+
"PositionY": 47.34285714285714,
25+
"Type": "Default"
26+
},
27+
{
28+
"Angle": 0,
29+
"CellX": null,
30+
"CellY": null,
31+
"ContainerId": 1,
32+
"Description": "",
33+
"Id": 2,
34+
"Name": "b",
35+
"PositionX": 583.2,
36+
"PositionY": 178.77142857142857,
37+
"Type": "Default"
38+
},
39+
{
40+
"Angle": 0,
41+
"CellX": null,
42+
"CellY": null,
43+
"ContainerId": 1,
44+
"Description": "",
45+
"Id": 3,
46+
"Name": "c",
47+
"PositionX": 678.2,
48+
"PositionY": 162.34285714285716,
49+
"Type": "Default"
50+
}
51+
]
52+
},
53+
"Model": {
54+
"Name": "ToyModelStable",
55+
"Relationships": [
56+
{
57+
"FromVariable": 1,
58+
"Id": 1,
59+
"ToVariable": 2,
60+
"Type": "Activator"
61+
},
62+
{
63+
"FromVariable": 2,
64+
"Id": 2,
65+
"ToVariable": 3,
66+
"Type": "Activator"
67+
},
68+
{
69+
"FromVariable": 3,
70+
"Id": 3,
71+
"ToVariable": 1,
72+
"Type": "Inhibitor"
73+
}
74+
],
75+
"Variables": [
76+
{
77+
"Formula": "",
78+
"Id": 1,
79+
"Name": "a",
80+
"RangeFrom": 0,
81+
"RangeTo": 4
82+
},
83+
{
84+
"Formula": "",
85+
"Id": 1,
86+
"Name": "b",
87+
"RangeFrom": 0,
88+
"RangeTo": 4
89+
},
90+
{
91+
"Formula": "",
92+
"Id": 1,
93+
"Name": "c",
94+
"RangeFrom": 0,
95+
"RangeTo": 4
96+
}
97+
]
98+
},
99+
"ltl": {
100+
"operations": [],
101+
"states": []
102+
}
103+
}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"Layout": {
3+
"AnnotatedGridCells": [],
4+
"Containers": [
5+
{
6+
"Id": 1,
7+
"Name": "C0",
8+
"PositionX": 2,
9+
"PositionY": 0,
10+
"Size": 1
11+
}
12+
],
13+
"Description": "",
14+
"Variables": [
15+
{
16+
"Angle": 0,
17+
"CellX": null,
18+
"CellY": null,
19+
"ContainerId": 1,
20+
"Description": "",
21+
"Id": 1,
22+
"Name": "a",
23+
"PositionX": 630.7,
24+
"PositionY": 47.34285714285714,
25+
"Type": "Default"
26+
},
27+
{
28+
"Angle": 0,
29+
"CellX": null,
30+
"CellY": null,
31+
"ContainerId": 1,
32+
"Description": "",
33+
"Id": 2,
34+
"Name": "b",
35+
"PositionX": 583.2,
36+
"PositionY": 178.77142857142857,
37+
"Type": "Default"
38+
},
39+
{
40+
"Angle": 0,
41+
"CellX": null,
42+
"CellY": null,
43+
"ContainerId": 1,
44+
"Description": "",
45+
"Id": 3,
46+
"Name": "c",
47+
"PositionX": 678.2,
48+
"PositionY": 162.34285714285716,
49+
"Type": "Default"
50+
}
51+
]
52+
},
53+
"Model": {
54+
"Name": "ToyModelStable",
55+
"Relationships": [
56+
{
57+
"FromVariable": 1,
58+
"Id": 1,
59+
"ToVariable": 2,
60+
"Type": "Activator"
61+
},
62+
{
63+
"FromVariable": 2,
64+
"Id": 2,
65+
"ToVariable": 3,
66+
"Type": "Activator"
67+
},
68+
{
69+
"FromVariable": 3,
70+
"Id": 3,
71+
"ToVariable": 1,
72+
"Type": "Inhibitor"
73+
},
74+
{
75+
"FromVariable": 4,
76+
"Id": 4,
77+
"ToVariable": 1,
78+
"Type": "Inhibitor"
79+
}
80+
],
81+
"Variables": [
82+
{
83+
"Formula": "min(var(c), var(c))",
84+
"Id": 1,
85+
"Name": "a",
86+
"RangeFrom": 0,
87+
"RangeTo": 4
88+
},
89+
{
90+
"Formula": "",
91+
"Id": 2,
92+
"Name": "b",
93+
"RangeFrom": 0,
94+
"RangeTo": 4
95+
},
96+
{
97+
"Formula": "",
98+
"Id": 3,
99+
"Name": "c",
100+
"RangeFrom": 0,
101+
"RangeTo": 4
102+
},
103+
{
104+
"Formula": "",
105+
"Id": 4,
106+
"Name": "c",
107+
"RangeFrom": 0,
108+
"RangeTo": 4
109+
}
110+
]
111+
},
112+
"ltl": {
113+
"operations": [],
114+
"states": []
115+
}
116+
}

test/resources/bma_models/RA_M1_macrophage_complex_corrected_phenotype_corrected_and_homogenized.json renamed to test/resources/bma_models/well_formed_examples/RA_M1_macrophage_complex_corrected_phenotype_corrected_and_homogenized.json

File renamed without changes.

test/resources/bma_models/RA_M2_macrophage_complex_corrected_phenotype_corrected_and_homogenized.json renamed to test/resources/bma_models/well_formed_examples/RA_M2_macrophage_complex_corrected_phenotype_corrected_and_homogenized.json

File renamed without changes.

test/resources/bma_models/RA_TH1_complex_corrected_phenotype_corrected_and_homogenized.json renamed to test/resources/bma_models/well_formed_examples/RA_TH1_complex_corrected_phenotype_corrected_and_homogenized.json

File renamed without changes.

test/resources/bma_models/RA_fibroblast_complex_corrected_phenotype_corrected_and_homogenized.json renamed to test/resources/bma_models/well_formed_examples/RA_fibroblast_complex_corrected_phenotype_corrected_and_homogenized.json

File renamed without changes.
File renamed without changes.

test/resources/bma_models/Skin1D.json renamed to test/resources/bma_models/well_formed_examples/Skin1D.json

File renamed without changes.

0 commit comments

Comments
 (0)