Skip to content

Commit a20eca6

Browse files
committed
test_mutate_deep_narrow_path moved to online tests
1 parent 0ec39a7 commit a20eca6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_gp_learner_online.py

+16
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from config import SPARQL_ENDPOINT
1717
from gp_learner import evaluate
18+
from gp_learner import mutate_deep_narrow_path
1819
from gp_learner import mutate_fix_var
1920
from gp_learner import update_individuals
2021
from gp_query import calibrate_query_timeout
@@ -134,6 +135,17 @@ def test_mutate_fix_var():
134135
assert gp.vars_in_graph - tgp.vars_in_graph
135136

136137

138+
def test_mutate_deep_narrow_path():
139+
p = Variable('p')
140+
gp = GraphPattern([
141+
(SOURCE_VAR, p, TARGET_VAR)
142+
])
143+
child = mutate_deep_narrow_path(gp, sparql, timeout, gtp_scores)
144+
assert gp == child or len(child) > len(gp)
145+
print(gp)
146+
print(child)
147+
148+
137149
def test_timeout_pattern():
138150
u = URIRef('http://dbpedia.org/resource/Template:Reflist')
139151
wpdisambig = URIRef('http://dbpedia.org/ontology/wikiPageDisambiguates')
@@ -158,3 +170,7 @@ def test_timeout_pattern():
158170
assert fitness.f_measure == 0
159171
else:
160172
assert fitness.f_measure > 0
173+
174+
175+
if __name__ == '__main__':
176+
test_mutate_deep_narrow_path()

0 commit comments

Comments
 (0)