Beispiel #1
0
def db_load_test():
    print 'load test is started..\n'
    db = Table(type=student, from_dump=True)
    # print student(db.get('581200', 1)).attrs
    print 'test get student with id = 581200..\n'
    print(student(to_parse=db.get('581200', 1)))
    print 'test neighbours of Matthew Cervantes..\n'
    nbrs = db.neighbours('name', 'Matthew Cervantes', 10)
    for nbr in nbrs:
        print nbr.attrs
    print 'test update Matthew Cervantes to Kamil..\n'
    print(student(to_parse=db.get('581200', 1)).attrs)
    db.update('581200', 1, {'name': 'Kamil'})
    print(student(to_parse=db.get('581200', 1)).attrs)
    print 'test remove Kamil by his id..\n'
    db.remove('581200', 1)
    if db.get('581200', 1) == None:
        print('Kamil is removed!')
Beispiel #2
0
def db_load_test():
    print 'load test is started..\n'
    db = Table(type=student, from_dump=True)
    # print student(db.get('581200', 1)).attrs
    print 'test get student with id = 581200..\n'
    print(student(to_parse=db.get('581200', 1)))
    print 'test neighbours of Matthew Cervantes..\n'
    nbrs = db.neighbours('name', 'Matthew Cervantes', 10)
    for nbr in nbrs:
        print nbr.attrs
    print 'test update Matthew Cervantes to Kamil..\n'
    print(student(to_parse=db.get('581200', 1)).attrs)
    db.update('581200', 1, {'name': 'Kamil'})
    print(student(to_parse=db.get('581200', 1)).attrs)
    print 'test remove Kamil by his id..\n'
    db.remove('581200', 1)
    if db.get('581200', 1) == None:
        print('Kamil is removed!')