From 4717f01ed33b26f6c0fbbf2cb83fbf681d14da41 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Tue, 7 Oct 2014 18:08:20 +0200 Subject: mv type sanity checks to neo4j_util --- src-py/neo4j_util.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src-py/neo4j_util.py') diff --git a/src-py/neo4j_util.py b/src-py/neo4j_util.py index c340e15a..2d870fcc 100644 --- a/src-py/neo4j_util.py +++ b/src-py/neo4j_util.py @@ -69,3 +69,15 @@ def where_clause_from_filter_attr_map(filter_attr_map, node_param_name="n"): filter_str = "where {0}".format(' and '.join(filter_arr)) return filter_str +def __type_check_link(link): + assert link.has_key('__src') + assert link.has_key('__dst') + +def __type_check_filter_attr_map(filter_attr_map): + """ + # type sanity check an attribute filter map + """ + assert isinstance(filter_attr_map, dict) + for k, v in filter_attr_map.items(): + assert isinstance(k, basestring) + assert isinstance(v, list) -- cgit v1.3.1