mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-24 10:43:16 +08:00
@@ -300,6 +300,36 @@ class TestUtilsComponentReuse:
|
||||
assert username_arg == username
|
||||
rmtree(module_dir)
|
||||
|
||||
@mock.patch("module_build_service.web.submit.submit_module_build")
|
||||
def test_submit_module_build_from_yaml_packager_v3(self, mock_submit):
|
||||
"""
|
||||
Tests local module build from a yaml file with the skiptests option
|
||||
|
||||
Args:
|
||||
mock_submit (MagickMock): mocked function submit_module_build, which we then
|
||||
inspect if it was called with correct arguments
|
||||
"""
|
||||
module_dir = tempfile.mkdtemp()
|
||||
modulemd_yaml = read_staged_data("v3/mmd_packager")
|
||||
modulemd_file_path = path.join(module_dir, "testmodule.yaml")
|
||||
|
||||
username = "test"
|
||||
stream = "dev"
|
||||
|
||||
with io.open(modulemd_file_path, "w", encoding="utf-8") as fd:
|
||||
fd.write(modulemd_yaml)
|
||||
|
||||
with open(modulemd_file_path, "rb") as fd:
|
||||
handle = FileStorage(fd)
|
||||
submit_module_build_from_yaml(
|
||||
db_session, username, handle, {}, stream=stream, skiptests=False)
|
||||
mock_submit_args = mock_submit.call_args[0]
|
||||
username_arg = mock_submit_args[1]
|
||||
mmd_arg = mock_submit_args[2]
|
||||
assert mmd_arg.get_stream_name() == stream
|
||||
assert username_arg == username
|
||||
rmtree(module_dir)
|
||||
|
||||
@mock.patch("module_build_service.web.submit.generate_expanded_mmds")
|
||||
def test_submit_build_new_mse_build(self, generate_expanded_mmds):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user