mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
updating the test fixture for ndbm. whichdb needs the filename w/o '.db' to correctly identify and dbm.open does not the extension to read it
This commit is contained in:
parent
99d077b89c
commit
d6cee750bc
@ -54,17 +54,16 @@ def make_gdbm_test_db(request):
|
||||
def make_ndbm_test_db(request):
|
||||
db_name = "test_ndbm"
|
||||
print "creating", db_name
|
||||
open(db_name+".db", 'a').close()
|
||||
test_db = ndbm.open(db_name+".db", "n")
|
||||
test_db = ndbm.open(db_name, "n")
|
||||
test_db['very first key'] = 'very first value'
|
||||
test_db['second key'] = 'second value'
|
||||
test_db.close()
|
||||
def delete_test_ndbm():
|
||||
print "deleting", db_name
|
||||
# os.remove(db_name+".db")
|
||||
os.remove(db_name+".db")
|
||||
|
||||
request.addfinalizer(delete_test_ndbm)
|
||||
return db_name+".db"
|
||||
return db_name
|
||||
|
||||
@pytest.fixture(scope = "function")
|
||||
def make_dumbdbm_test_db(request):
|
||||
|
Loading…
x
Reference in New Issue
Block a user