From aa7df2efc5f080eda44c16dcd56133c282a45b7e Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 21 Sep 2020 12:27:33 +0200 Subject: [PATCH] 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). --- test/unit/test_builder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/unit/test_builder.py b/test/unit/test_builder.py index 1fce182..4a3ce51 100644 --- a/test/unit/test_builder.py +++ b/test/unit/test_builder.py @@ -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