test/builder: check repo configuration

In the test_compose_success check, after the build is "done",
check the repositories in compose request match with what
we expect.
This commit is contained in:
Christian Kellner 2020-09-16 16:36:20 +02:00
parent 41ee1f1708
commit 78cef84f67

View file

@ -250,11 +250,12 @@ class TestBuilderPlugin(PluginTest):
session,
options)
repos = ["http://1.repo", "https://2.repo"]
args = ["name", "version", "distro",
["image_type"],
"fedora-candidate",
["x86_64"],
{}]
{"repo": ",".join(repos)}]
url = self.plugin.DEFAULT_COMPOSER_URL
composer = MockComposer(url, architectures=["x86_64"])
@ -262,6 +263,15 @@ class TestBuilderPlugin(PluginTest):
res = handler.handler(*args)
assert res, "invalid compose result"
compose_id = res["composer_id"]
compose = composer.composes.get(compose_id)
self.assertIsNotNone(compose)
ireqs = compose["request"]["image_requests"]
for ir in ireqs:
self.assertEqual(ir["architecture"], "x86_64")
have = [r["baseurl"] for r in ir["repositories"]]
self.assertEqual(have, repos)
@httpretty.activate
def test_cli_compose_success(self):