Move vcrpy cache to gzipped tarball and extract it before tests execution.

This commit is contained in:
Jan Kaluza
2017-09-08 11:35:24 +02:00
parent 83628ec74f
commit aa8a0574e4
29 changed files with 11 additions and 44966 deletions

View File

@@ -21,6 +21,7 @@
# Written by Matt Prahl <mprahl@redhat.com
import os
import tarfile
import module_build_service
from datetime import datetime, timedelta
@@ -35,6 +36,15 @@ app = module_build_service.app
conf = init_config(app)
def uncompress_vcrpy_cassette():
cassette_dir = base_dir + '/vcr-request-data/'
if not os.path.exists(cassette_dir):
archive = cassette_dir.rstrip('/') + ".tar.gz"
with tarfile.open(archive, mode='r:gz') as t:
t.extractall(base_dir)
uncompress_vcrpy_cassette()
def init_data():
db.session.remove()
db.drop_all()