mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
added test for dump-anydbm that uses module subprocess to run script
This commit is contained in:
parent
24a3437fda
commit
efb96ee0c3
@ -3,6 +3,7 @@
|
|||||||
#from warcprox.bin import dump-anydbm
|
#from warcprox.bin import dump-anydbm
|
||||||
import pytest
|
import pytest
|
||||||
import os
|
import os
|
||||||
|
import subprocess # to access the script from shell
|
||||||
|
|
||||||
# will try as python 3 then default to python 2 modules
|
# will try as python 3 then default to python 2 modules
|
||||||
try:
|
try:
|
||||||
@ -71,5 +72,16 @@ def test_assert_reading_dumbdbm_correctly(make_dumbdbm_test_db):
|
|||||||
assert db.has_key('very first key')
|
assert db.has_key('very first key')
|
||||||
assert db['very first key'] == 'very first value'
|
assert db['very first key'] == 'very first value'
|
||||||
|
|
||||||
|
def test_dumpanydbm_identify_gbdm(make_gdbm_test_db):
|
||||||
|
print "running test_dumpanydbm_identify_gbdm"
|
||||||
|
output = subprocess.check_output(["dump-anydbm", make_gdbm_test_db])
|
||||||
|
output = output.split("/n")
|
||||||
|
|
||||||
|
# split on space, then grab 4th word, which is db type
|
||||||
|
which = output[0].split(' ')[3]
|
||||||
|
print which
|
||||||
|
assert which == "gdbm" or "dbm.gdbm"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user