Exemplo n.º 1
0
except EntityError, e:
    print e
else:
    print 'Created Entity successfully, should of thrown error, missing index'

#   Lets actually give it the proper parameters
test = test_entity.create({
    'test':'abc123',
    'b':'hello'
})

#   Now lets try finding it by id, then by index test and b
print test_entity.find(id=test['id'])
print test_entity.find(test=test['test'])
print test_entity.find(b=test['b'])
print 'count', test_entity.count(id=test['id'])
print 'count test=', test_entity.count(test=test['test'])
print 'count index=', test_entity.count(b=test['b'])
print 'empty', test_entity.count(id='ab2c')

#   Okay, lets test the update thing :)~
test['test'] = 'EHheE'
test_entity.update(test)
print test_entity.find(test=test['test'])
print test_entity.count(test=test['test'])

#   Now delete.
test_entity.remove(test)
print test_entity.count(id=test['id'])