osbs: Verify the .repo files contain correct URL

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-01-04 09:19:25 +01:00
parent 814bf4484b
commit 61a4c43db0

View File

@ -192,10 +192,12 @@ class OSBSThreadTest(helpers.PungiTestCase):
mock.call.koji_proxy.getBuild(54321), mock.call.koji_proxy.getBuild(54321),
mock.call.koji_proxy.listArchives(54321)]) mock.call.koji_proxy.listArchives(54321)])
def _assertRepoFile(self): def _assertRepoFile(self, variants=None):
with open(self.topdir + '/work/global/tmp-Server/compose-rpms-1.repo') as f: variants = variants or ['Server']
lines = f.read().split('\n') for variant in variants:
self.assertIn('baseurl=http://root/compose/Server/$baseurl/os', lines) with open(self.topdir + '/work/global/tmp-%s/compose-rpms-1.repo' % variant) as f:
lines = f.read().split('\n')
self.assertIn('baseurl=http://root/compose/%s/$basearch/os' % variant, lines)
@mock.patch('pungi.util.resolve_git_url') @mock.patch('pungi.util.resolve_git_url')
@mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper') @mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper')
@ -210,6 +212,7 @@ class OSBSThreadTest(helpers.PungiTestCase):
self._assertCorrectCalls({}) self._assertCorrectCalls({})
self._assertCorrectMetadata() self._assertCorrectMetadata()
self._assertRepoFile()
@mock.patch('pungi.util.resolve_git_url') @mock.patch('pungi.util.resolve_git_url')
@mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper') @mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper')
@ -225,6 +228,7 @@ class OSBSThreadTest(helpers.PungiTestCase):
self._assertCorrectCalls({}) self._assertCorrectCalls({})
self._assertCorrectMetadata() self._assertCorrectMetadata()
self._assertRepoFile()
@mock.patch('pungi.util.resolve_git_url') @mock.patch('pungi.util.resolve_git_url')
@mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper') @mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper')
@ -241,6 +245,7 @@ class OSBSThreadTest(helpers.PungiTestCase):
self._assertCorrectCalls({'name': 'my-name', 'version': '1.0'}) self._assertCorrectCalls({'name': 'my-name', 'version': '1.0'})
self._assertCorrectMetadata() self._assertCorrectMetadata()
self._assertRepoFile()
@mock.patch('pungi.util.resolve_git_url') @mock.patch('pungi.util.resolve_git_url')
@mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper') @mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper')
@ -268,6 +273,7 @@ class OSBSThreadTest(helpers.PungiTestCase):
} }
self._assertCorrectCalls(options) self._assertCorrectCalls(options)
self._assertCorrectMetadata() self._assertCorrectMetadata()
self._assertRepoFile(['Server', 'Everything'])
@mock.patch('pungi.util.resolve_git_url') @mock.patch('pungi.util.resolve_git_url')
@mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper') @mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper')
@ -296,6 +302,7 @@ class OSBSThreadTest(helpers.PungiTestCase):
} }
self._assertCorrectCalls(options) self._assertCorrectCalls(options)
self._assertCorrectMetadata() self._assertCorrectMetadata()
self._assertRepoFile(['Server', 'Everything', 'Client'])
@mock.patch('pungi.util.resolve_git_url') @mock.patch('pungi.util.resolve_git_url')
@mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper') @mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper')