mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
adapted reading for dumbdbm. also removed the '.dir' from the name being passed through. Not needed for whichdb or .open
This commit is contained in:
parent
0f48f6bed9
commit
24a3437fda
@ -47,7 +47,7 @@ def make_dumbdbm_test_db(request):
|
||||
os.remove(db_name+".dat")
|
||||
|
||||
request.addfinalizer(delete_test_dumbdbm)
|
||||
return db_name+".dir"
|
||||
return db_name
|
||||
|
||||
def test_assert_gdbm_db_is_created_and_correctly_identified(make_gdbm_test_db):
|
||||
print "runing assert_gdbm_db_is_created_and_correctly_identified with gdbm test file"
|
||||
@ -62,4 +62,14 @@ def test_assert_reading_gdbm_correctly(make_gdbm_test_db):
|
||||
|
||||
def test_assert_dumbdbm_db_is_created_and_correctly_identified(make_dumbdbm_test_db):
|
||||
print "runing assert_dumbdbm_db_is_created_and_correctly_identified with gdbm test file"
|
||||
assert whichdb(make_dumbdbm_test_db) == "dbm.dumb" or "dumbdbm"
|
||||
assert whichdb(make_dumbdbm_test_db) == "dbm.dumb" or "dumbdbm"
|
||||
|
||||
def test_assert_reading_dumbdbm_correctly(make_dumbdbm_test_db):
|
||||
print "running assert_reading_dumbdbm_correctly with dumbdbm test db"
|
||||
db = dumb.open(make_dumbdbm_test_db, "r")
|
||||
assert len(db.keys()) == 2
|
||||
assert db.has_key('very first key')
|
||||
assert db['very first key'] == 'very first value'
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user