diff options
| author | LV-426 <lv-426@taproot.org.il> | 2015-01-05 13:18:30 +0200 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2015-01-05 13:20:34 +0200 |
| commit | d01bb481a085e003ba0e2663b62f7e87abd41726 (patch) | |
| tree | 1a35b0b24a6ad40af2edb6391614c5b366f8f1b8 /src/server-tests | |
| parent | 89b8328253693333b2d8b3075c4218798b00e56d (diff) | |
rz_api, neo4j_test_util: imports
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) |
