mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
some debugging to try to figure out what the hell is up with tox saying OSError: [Errno 2] No such file or directory: /tmp/tmpnz51j6.db
This commit is contained in:
parent
111c678cee
commit
1cdc013c75
@ -41,15 +41,15 @@ dump_anydbm_loc = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(_
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def gdbm_test_db(request):
|
||||
print("creating test gdbm file")
|
||||
temp_file = tempfile.NamedTemporaryFile()
|
||||
print("creating test gdbm file {}".format(temp_file.name))
|
||||
test_db = gdbm.open(temp_file.name, "n")
|
||||
test_db[key1] = val1
|
||||
test_db[key2] = val2
|
||||
test_db.close()
|
||||
|
||||
def delete_gdbm_test_db():
|
||||
print("deleting test gdbm file")
|
||||
print("deleting test gdbm file {}".format(temp_file.name))
|
||||
temp_file.close()
|
||||
|
||||
request.addfinalizer(delete_gdbm_test_db)
|
||||
@ -58,17 +58,24 @@ def gdbm_test_db(request):
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def ndbm_test_db(request):
|
||||
print("creating test ndbm file")
|
||||
# print("00") ; subprocess.call("ls -l {}*".format(temp_file.name), shell=True)
|
||||
temp_file = tempfile.NamedTemporaryFile()
|
||||
print("10") ; subprocess.call("ls -l {}*".format(temp_file.name), shell=True)
|
||||
print("creating test ndbm file {}".format(temp_file.name))
|
||||
test_db = ndbm.open(temp_file.name, "n")
|
||||
print("20") ; subprocess.call("ls -l {}*".format(temp_file.name), shell=True)
|
||||
test_db[key1] = val1
|
||||
test_db[key2] = val2
|
||||
test_db.close()
|
||||
subprocess.call("ls -l {}*".format(temp_file.name), shell=True)
|
||||
print("30") ; subprocess.call("ls -l {}*".format(temp_file.name), shell=True)
|
||||
|
||||
def delete_test_ndbm():
|
||||
print("deleting test ndbm file")
|
||||
print("deleting test ndbm file {}.db".format(temp_file.name))
|
||||
temp_file.close()
|
||||
print("40") ; subprocess.call("ls -l {}*".format(temp_file.name), shell=True)
|
||||
os.remove(temp_file.name + ".db")
|
||||
print("50") ; subprocess.call("ls -l {}*".format(temp_file.name), shell=True)
|
||||
|
||||
request.addfinalizer(delete_test_ndbm)
|
||||
return temp_file.name
|
||||
@ -76,15 +83,15 @@ def ndbm_test_db(request):
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def dumbdbm_test_db(request):
|
||||
print("creating test dumbdbm file")
|
||||
temp_file = tempfile.NamedTemporaryFile()
|
||||
print("creating test dumbdbm file {}".format(temp_file.name))
|
||||
test_db = dumb.open(temp_file.name, "n")
|
||||
test_db[key1] = val1
|
||||
test_db[key2] = val2
|
||||
test_db.close()
|
||||
|
||||
def delete_dumbdbm_test_db():
|
||||
print("deleting test dumbdbm file")
|
||||
print("deleting test dumbdbm file {}".format(temp_file.name))
|
||||
temp_file.close()
|
||||
os.remove(temp_file.name + ".dir")
|
||||
os.remove(temp_file.name + ".bak")
|
||||
@ -97,9 +104,9 @@ def dumbdbm_test_db(request):
|
||||
def test_dumpanydbm_identify_gdbm(gdbm_test_db):
|
||||
print("running test_dumpanydbm_identify_gdbm")
|
||||
output = subprocess.check_output([py, dump_anydbm_loc, gdbm_test_db])
|
||||
print(b"script printout: ")
|
||||
print("script printout: ")
|
||||
print(output)
|
||||
print(b"check_one: ")
|
||||
print("check_one: ")
|
||||
print(gdbm_test_db.encode(encoding='UTF-8') + b' is a ' + gdbm_type + b' db\nvery first key:very first value\nsecond key:second value\n')
|
||||
|
||||
assert (output == gdbm_test_db.encode(encoding='UTF-8') + b' is a ' + gdbm_type + b' db\nvery first key:very first value\nsecond key:second value\n' or
|
||||
@ -109,9 +116,9 @@ def test_dumpanydbm_identify_gdbm(gdbm_test_db):
|
||||
def test_dumpanydbm_identify_ndbm(ndbm_test_db):
|
||||
print("running test_dumpanydbm_identify_ndbm")
|
||||
output = subprocess.check_output([py, dump_anydbm_loc, ndbm_test_db])
|
||||
print(b"script printout: ")
|
||||
print("script printout: ")
|
||||
print(output)
|
||||
print(b"check_one: ")
|
||||
print("check_one: ")
|
||||
print(ndbm_test_db.encode(encoding='UTF-8') + b' is a ' + ndbm_type + b' db\nvery first key:very first value\nsecond key:second value\n')
|
||||
|
||||
assert (output == ndbm_test_db.encode(encoding='UTF-8') + b' is a ' + ndbm_type + b' db\nvery first key:very first value\nsecond key:second value\n' or
|
||||
@ -122,9 +129,9 @@ def test_dumpanydbm_identify_dumbdbm(dumbdbm_test_db):
|
||||
print("running test_dumpanydbm_identify_dumbdbm")
|
||||
|
||||
output = subprocess.check_output([py, dump_anydbm_loc, dumbdbm_test_db])
|
||||
print(b"script printout: ")
|
||||
print("script printout: ")
|
||||
print(output)
|
||||
print(b"check_one: ")
|
||||
print("check_one: ")
|
||||
print(dumbdbm_test_db.encode(encoding='UTF-8') + b' is a ' + dumb_type + b' db\nvery first key:very first value\nsecond key:second value\n')
|
||||
|
||||
assert (output == dumbdbm_test_db.encode(encoding='UTF-8') + b' is a ' + dumb_type + b' db\nvery first key:very first value\nsecond key:second value\n' or
|
||||
|
Loading…
x
Reference in New Issue
Block a user