From 24fbefdcd0b82cd53d7961f7412e4292844af3a2 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Tue, 28 Oct 2014 00:34:40 +0200 Subject: random neo4j label generator --- src-py/neo4j_test_util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src-py') diff --git a/src-py/neo4j_test_util.py b/src-py/neo4j_test_util.py index d5c30a7f..d5aa640a 100644 --- a/src-py/neo4j_test_util.py +++ b/src-py/neo4j_test_util.py @@ -1,8 +1,18 @@ import uuid +import string +from random import choice +import db_controller as dbc def rand_id(): return str(uuid.uuid4()) +def rand_label(length=8): + """ + return random label + """ + char_set = string.ascii_lowercase + string.ascii_uppercase + string.digits + return ''.join([choice(string.ascii_lowercase)] + [choice(char_set) for _ in range(length - 1)]) + def flush_db(db_ctl): """ complete DB flush: remove all nodes & links -- cgit v1.3.1