Add API call to get final modulemds of builds

This commit is contained in:
Brendan Reilly
2020-06-15 14:55:57 -04:00
parent 5b770dfbf5
commit db70560d2d
4 changed files with 64 additions and 0 deletions

View File

@@ -2945,3 +2945,18 @@ class TestLogMessageViews:
assert "Build-1" not in json_res
assert "Build-2" not in json_res
assert "Component-1" in json_res
@pytest.mark.usefixtures("provide_test_client")
@pytest.mark.usefixtures("provide_test_data")
class TestFinalModulemdViews:
@patch("module_build_service.builder.KojiContentGenerator.KojiContentGenerator.get_final_mmds")
def test_view_final_modulemd(self, mocked_cg):
mocked_cg.return_value = {'x86_64': 'finalized mmd'}
url = "/module-build-service/1/final-modulemd/2"
res = self.client.get(url)
json_res = str(res.data)
assert "x86_64" in json_res
assert "finalized mmd" in json_res