Commit cfceb417 authored by Jérome Perrin's avatar Jérome Perrin

unpack the content of testIngestion_docs.zip at runtime



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13873 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 59b4e32b
...@@ -85,7 +85,7 @@ class FileUploadTest(file): ...@@ -85,7 +85,7 @@ class FileUploadTest(file):
self.headers = {} self.headers = {}
def makeFilePath(name): def makeFilePath(name):
return os.getenv('INSTANCE_HOME') + '/../Products/ERP5OOo/tests/' + name return os.getenv('INSTANCE_HOME') + '/../Products/ERP5OOo/tests/data/' + name
def makeFileUpload(name): def makeFileUpload(name):
path = makeFilePath(name) path = makeFilePath(name)
...@@ -128,6 +128,26 @@ class TestIngestion(ERP5TypeTestCase): ...@@ -128,6 +128,26 @@ class TestIngestion(ERP5TypeTestCase):
self.createCategories() self.createCategories()
self.createPreferences() self.createPreferences()
self.createTools() self.createTools()
self.unpackData()
def unpackData(self):
"""
Unpack the content of testIngestion_docs.zip
"""
join = os.path.join
base_path = join(os.getenv('INSTANCE_HOME'), '..', 'Products', 'ERP5OOo', 'tests')
zf = zipfile.ZipFile(join(base_path, 'testIngestion_docs.zip'))
data_dir = join(base_path, 'data')
if not os.path.isdir(data_dir):
os.mkdir(data_dir)
for name in zf.namelist():
fname = join(data_dir, name)
if not os.path.exists(fname):
try:
f = open(fname, 'w')
f.write(zf.read(name))
finally:
f.close()
def createTools(self): def createTools(self):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment