Use vcrpy for tests to simulate PDC responses.

This commit is contained in:
Jan Kaluza
2017-01-12 11:52:49 +01:00
parent ca754903ac
commit 4acc1d69aa
11 changed files with 1661 additions and 25 deletions

View File

@@ -32,30 +32,6 @@ import module_build_service.pdc
app = module_build_service.app
conf = init_config(app)
def local_resolve_profiles(pdc_session, mmd, keys):
"""
Returns the default srpm-buildroot and "buildroot" groups as they
would have been return from PDC.
We are not using real PDC for resolve_profiles in tests,
because it makes tests slower and depending on the remote dev
PDC instance which is not ideal.
"""
default_groups = {
'srpm-buildroot':
set(['shadow-utils', 'fedora-release', 'redhat-rpm-config',
'rpm-build', 'fedpkg-minimal', 'gnupg2', 'bash']),
'buildroot':
set(['unzip', 'fedora-release', 'tar', 'cpio', 'gawk',
'gcc', 'xz', 'sed', 'findutils', 'util-linux', 'bash',
'info', 'bzip2', 'grep', 'redhat-rpm-config',
'diffutils', 'make', 'patch', 'shadow-utils',
'coreutils', 'which', 'rpm-build', 'gzip', 'gcc-c++'])}
return default_groups
module_build_service.pdc.resolve_profiles = local_resolve_profiles
def init_data():
db.session.remove()
db.drop_all()