Beispiel #1
0
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]
Beispiel #2
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")
Beispiel #3
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")
Beispiel #4
0
def check_not_in_record(k, d):
    if k in d: fail("'" + k + "' not found in " + str(d))
Beispiel #5
0
def check_no_stragglers(m, ks):
    r = remainder_of(m, ks)
    if r: fail("spurious keys '" + str(r) + "' in '" + str(m) + "'")
Beispiel #6
0
def check_not_in_content(m, k, v, c):
    if not in_content(k, v, c): fail(m + " with '" + k + '=' + v + "' exists")
Beispiel #7
0
def check_in_content(m, k, v, c):
    if in_content(k, v, c):
        fail(m + " with '" + k + '=' + v + "' does not exist")
Beispiel #8
0
def record_add(k, v, record):
    if k in record:
        fail("record should not already have key '" + k + "' value '" +
             record[k] + "'")
    record[k] = v
Beispiel #9
0
def create_it(which, header, attr):
  if attr in header: fail(which+" attribute '"+attr+"' already exists "+str(header))
  header.append(attr) 
Beispiel #10
0
def record_add(k, v, record):
    if k in record:
        fail("record should not already have key '" + k + "' value '" + record[k] + "'")
    record[k] = v
Beispiel #11
0
def create_it(which, header, attr):
    if attr in header:
        fail(which + " attribute '" + attr + "' already exists " + str(header))
    header.append(attr)
Beispiel #12
0
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]
Beispiel #13
0
def check_in_content(m, k, v, c):
  if in_content(k, v, c): fail(m+" with '"+k+'='+v+"' does not exist")
Beispiel #14
0
def check_not_in_record(k, d):
  if k in d: fail("'"+k+"' not found in "+str(d))
Beispiel #15
0
def check_no_stragglers(m, ks):
  r = remainder_of(m, ks)
  if r: fail ("spurious keys '"+str(r)+"' in '"+str(m)+"'")
Beispiel #16
0
def check_not_in_content(m, k, v, c):
  if not in_content(k, v, c): fail(m+" with '"+k+'='+v+"' exists")