You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/test_hello_world.py
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@
4
4
5
5
deftest_hello_world():
6
6
# Modify the paths based on where you've stored the files we made above
7
-
graph_path='./tests/friends_graph.graphml'
7
+
# graph_path = './tests/friends_graph.graphml'
8
+
graph_path='./friends_graph.graphml'
8
9
9
10
# Modify pyreason settings to make verbose and to save the rule trace to a file
10
11
pr.settings.verbose=True# Print info to screen
@@ -28,11 +29,16 @@ def test_hello_world():
28
29
assertlen(dataframes[1]) ==2, 'At t=0 there should be two popular people'
29
30
assertlen(dataframes[2]) ==3, 'At t=0 there should be three popular people'
30
31
31
-
assertdataframes[0].iloc[0].component=='Mary'anddataframes[0].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=0 timesteps'
32
-
assertdataframes[1].iloc[0].component=='Mary'anddataframes[1].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=1 timesteps'
33
-
assertdataframes[2].iloc[0].component=='Mary'anddataframes[2].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=2 timesteps'
32
+
# Mary should be popular in all three timesteps
33
+
assert'Mary'indataframes[0]['component'].valuesanddataframes[0].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=0 timesteps'
34
+
assert'Mary'indataframes[1]['component'].valuesanddataframes[1].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=1 timesteps'
35
+
assert'Mary'indataframes[2]['component'].valuesanddataframes[2].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=2 timesteps'
34
36
35
-
assertdataframes[1].iloc[1].component=='Justin'anddataframes[1].iloc[1].popular== [1, 1], 'Justin should have popular bounds [1,1] for t=1 timesteps'
36
-
assertdataframes[2].iloc[2].component=='Justin'anddataframes[2].iloc[2].popular== [1, 1], 'Justin should have popular bounds [1,1] for t=2 timesteps'
37
+
# Justin should be popular in timesteps 1, 2
38
+
assert'Justin'indataframes[1]['component'].valuesanddataframes[1].iloc[1].popular== [1, 1], 'Justin should have popular bounds [1,1] for t=1 timesteps'
39
+
assert'Justin'indataframes[2]['component'].valuesanddataframes[2].iloc[2].popular== [1, 1], 'Justin should have popular bounds [1,1] for t=2 timesteps'
37
40
38
-
assertdataframes[2].iloc[1].component=='John'anddataframes[2].iloc[1].popular== [1, 1], 'John should have popular bounds [1,1] for t=2 timesteps'
41
+
# John should be popular in timestep 3
42
+
assert'John'indataframes[2]['component'].valuesanddataframes[2].iloc[1].popular== [1, 1], 'John should have popular bounds [1,1] for t=2 timesteps'
assertlen(dataframes[1]) ==2, 'At t=0 there should be two popular people'
30
31
assertlen(dataframes[2]) ==3, 'At t=0 there should be three popular people'
31
32
32
-
assertdataframes[0].iloc[0].component=='Mary'anddataframes[0].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=0 timesteps'
33
-
assertdataframes[1].iloc[0].component=='Mary'anddataframes[1].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=1 timesteps'
34
-
assertdataframes[2].iloc[0].component=='Mary'anddataframes[2].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=2 timesteps'
33
+
# Mary should be popular in all three timesteps
34
+
assert'Mary'indataframes[0]['component'].valuesanddataframes[0].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=0 timesteps'
35
+
assert'Mary'indataframes[1]['component'].valuesanddataframes[1].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=1 timesteps'
36
+
assert'Mary'indataframes[2]['component'].valuesanddataframes[2].iloc[0].popular== [1, 1], 'Mary should have popular bounds [1,1] for t=2 timesteps'
35
37
36
-
assertdataframes[1].iloc[1].component=='Justin'anddataframes[1].iloc[1].popular== [1, 1], 'Justin should have popular bounds [1,1] for t=1 timesteps'
37
-
assertdataframes[2].iloc[2].component=='Justin'anddataframes[2].iloc[2].popular== [1, 1], 'Justin should have popular bounds [1,1] for t=2 timesteps'
38
+
# Justin should be popular in timesteps 1, 2
39
+
assert'Justin'indataframes[1]['component'].valuesanddataframes[1].iloc[1].popular== [1, 1], 'Justin should have popular bounds [1,1] for t=1 timesteps'
40
+
assert'Justin'indataframes[2]['component'].valuesanddataframes[2].iloc[2].popular== [1, 1], 'Justin should have popular bounds [1,1] for t=2 timesteps'
38
41
39
-
assertdataframes[2].iloc[1].component=='John'anddataframes[2].iloc[1].popular== [1, 1], 'John should have popular bounds [1,1] for t=2 timesteps'
42
+
# John should be popular in timestep 3
43
+
assert'John'indataframes[2]['component'].valuesanddataframes[2].iloc[1].popular== [1, 1], 'John should have popular bounds [1,1] for t=2 timesteps'
0 commit comments