def update():

    # Update a few values
    d = BeeDict.BeeDict('testernesto', autocommit=AUTOCOMMIT)
    for i in range(100, 3000):
        d[i] = "C" * i
    d.commit()
예제 #2
0
def part2():

    # Update a few values
    d = BeeDict.BeeDict('testernesto', autocommit=1)
    for i in range(100, 300):
        d[i] = "C" * i
    d.commit()
def fill():

    # Fill initial version of the dictionary
    d = BeeDict.BeeDict('testernesto', autocommit=AUTOCOMMIT)
    for i in range(10000):
        d[i] = "A" * i
    d.commit()
    #d.free_cache()
    d.close()
예제 #4
0
s = BeeStringDict(testfile, keysize=99)
assert s['foo'] == 'test'
assert s['foo1'] == 'test1'
s.commit()
s.close()

s.remove_files()

print 'done.'

###

print 'Testing BeeDict...',

s = BeeDict(testfile)
s['foo'] = 'bar'
assert s['foo'] == 'bar'
s.commit()
s.close()

s = BeeDict(testfile)
assert s['foo'] == 'bar'
s.close()

s = BeeDict(testfile)
assert s['foo'] == 'bar'
s['foo'] = 'test'
assert s['foo'] == 'test'
s['foo1'] = 'test1'
assert s['foo1'] == 'test1'
예제 #5
0
s = BeeStringDict(testdict, keysize=99)
assert s['foo'] == 'test'
assert s['foo1'] == 'test1'
s.commit()
s.close()

s.remove_files()

print 'done.'

###

print 'Testing BeeDict...',

s = BeeDict(testdict)
s['foo'] = 'bar'
assert s['foo'] == 'bar'
s.commit()
s.close()

s = BeeDict(testdict)
assert s['foo'] == 'bar'
s.close()

s = BeeDict(testdict)
assert s['foo'] == 'bar'
s['foo'] = 'test'
assert s['foo'] == 'test'
s['foo1'] = 'test1'
assert s['foo1'] == 'test1'