test/builder: assert the compose request is saved

Assert, via the new UploadTracker, that the "compose-request.json"
is always saved, especially in the case where composer refuses the
compose (via bad request).
This commit is contained in:
Christian Kellner 2020-09-21 12:27:33 +02:00
parent d300c96f1f
commit aa7df2efc5

View file

@ -353,6 +353,8 @@ class TestBuilderPlugin(PluginTest):
with self.assertRaises(koji.GenericError):
handler.handler(*args)
self.uploads.assert_upload("compose-request.json")
@httpretty.activate
def test_compose_success(self):
# Simulate a successful compose, check return value
@ -388,6 +390,8 @@ class TestBuilderPlugin(PluginTest):
have = [r["baseurl"] for r in ir["repositories"]]
self.assertEqual(have, repos)
self.uploads.assert_upload("compose-request.json")
@httpretty.activate
def test_compose_failure(self):
# Simulate a failed compose, check exception is raised
@ -415,6 +419,8 @@ class TestBuilderPlugin(PluginTest):
with self.assertRaises(koji.BuildError):
handler.handler(*args)
self.uploads.assert_upload("compose-request.json")
@httpretty.activate
def test_cli_compose_success(self):
# Check the basic usage of the plugin as a stand-alone client