def get_record(k, v, c): r = get_records(k, v, c) if len(r) == 0: fail("no record found with key '" + k + "' and value '" + v + "'") if len(r) > 1: fail("expected one record but found multiple with key '" + k + "' and value '" + v + "'") return r[0]
def local_create(name): if not p.isdir(store()): fail("store area "+store()+" does not exist") if p.exists(project(name)): fail("store "+project(name)+" already exists") mkdir(project(name)) create(nodes(name), "Id,Label") create(edges(name), "Source,Target,Type,Id,Label,Weight")
def local_create(name): if not p.isdir(store()): fail("store area " + store() + " does not exist") if p.exists(project(name)): fail("store " + project(name) + " already exists") mkdir(project(name)) create(nodes(name), "Id,Label") create(edges(name), "Source,Target,Type,Id,Label,Weight")
def check_not_in_record(k, d): if k in d: fail("'" + k + "' not found in " + str(d))
def check_no_stragglers(m, ks): r = remainder_of(m, ks) if r: fail("spurious keys '" + str(r) + "' in '" + str(m) + "'")
def check_not_in_content(m, k, v, c): if not in_content(k, v, c): fail(m + " with '" + k + '=' + v + "' exists")
def check_in_content(m, k, v, c): if in_content(k, v, c): fail(m + " with '" + k + '=' + v + "' does not exist")
def record_add(k, v, record): if k in record: fail("record should not already have key '" + k + "' value '" + record[k] + "'") record[k] = v
def create_it(which, header, attr): if attr in header: fail(which+" attribute '"+attr+"' already exists "+str(header)) header.append(attr)
def create_it(which, header, attr): if attr in header: fail(which + " attribute '" + attr + "' already exists " + str(header)) header.append(attr)
def get_record(k, v, c): r = get_records(k, v, c) if len(r) == 0: fail("no record found with key '"+k+"' and value '"+v+"'") if len(r) > 1: fail("expected one record but found multiple with key '"+k+"' and value '"+v+"'") return r[0]
def check_in_content(m, k, v, c): if in_content(k, v, c): fail(m+" with '"+k+'='+v+"' does not exist")
def check_not_in_record(k, d): if k in d: fail("'"+k+"' not found in "+str(d))
def check_no_stragglers(m, ks): r = remainder_of(m, ks) if r: fail ("spurious keys '"+str(r)+"' in '"+str(m)+"'")
def check_not_in_content(m, k, v, c): if not in_content(k, v, c): fail(m+" with '"+k+'='+v+"' exists")