diff options
Diffstat (limited to 'src/server-tests')
| -rw-r--r-- | src/server-tests/neo4j_test_util.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/server-tests/neo4j_test_util.py b/src/server-tests/neo4j_test_util.py index e8e48895..90d9239b 100644 --- a/src/server-tests/neo4j_test_util.py +++ b/src/server-tests/neo4j_test_util.py @@ -1,7 +1,8 @@ -import uuid -import string from random import choice -import db_controller as dbc +import string +import uuid + +from db_op import DBO_cypher_query def rand_id(): return str(uuid.uuid4()) @@ -30,14 +31,14 @@ def gen_rand_data(db_ctl, lim_n=128, lim_r=256, prob_link_create=0.3): n_label = rand_label() r_label = rand_label() - q_arr = ['with 0 as _', # TODO clean: foreach triggers SyntaxException: otherwise + q_arr = ['with 0 as _', # TODO clean: foreach triggers SyntaxException: otherwise 'foreach (rid in range(0,%d)' % (lim_n - 1), '|', 'create (:%s {id:rid, n_attr_0:toInt(%d * rand())}))' % (n_label, lim_n) ] q = ' '.join(q_arr) - op = dbc.DBO_cypher_query(q) + op = DBO_cypher_query(q) db_ctl.exec_op(op) q_arr = ['match (s:%s),(d:%s)' % (n_label, n_label), @@ -47,7 +48,7 @@ def gen_rand_data(db_ctl, lim_n=128, lim_r=256, prob_link_create=0.3): 'create (s)-[:%s {l_attr_0:toInt(%d * rand())}]->(d)' % (r_label, lim_r)] q = ' '.join(q_arr) - op = dbc.DBO_cypher_query(q) + op = DBO_cypher_query(q) db_ctl.exec_op(op) return (n_label, r_label) |
