mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-05-12 02:46:57 +08:00
@@ -4,7 +4,9 @@ from __future__ import absolute_import
|
||||
|
||||
import mock
|
||||
|
||||
from module_build_service.common.submit import _is_eol_in_pdc
|
||||
from module_build_service.common.modulemd import Modulemd
|
||||
from module_build_service.common.submit import _is_eol_in_pdc, fetch_mmd
|
||||
from tests.test_web.test_views import FakeSCM
|
||||
|
||||
|
||||
@mock.patch("module_build_service.common.submit.requests")
|
||||
@@ -32,3 +34,31 @@ def test_pdc_eol_check(requests):
|
||||
|
||||
is_eol = _is_eol_in_pdc("mariadb", "10.1")
|
||||
assert is_eol
|
||||
|
||||
|
||||
@mock.patch("module_build_service.common.scm.SCM")
|
||||
def test_fetch_mmd(mocked_scm):
|
||||
""" Test behavior for fetch_mmd """
|
||||
|
||||
FakeSCM(
|
||||
mocked_scm,
|
||||
"testmodule",
|
||||
"testmodule.yaml",
|
||||
"620ec77321b2ea7b0d67d82992dda3e1d67055b4")
|
||||
|
||||
mmd, scm = fetch_mmd('testurl')
|
||||
assert isinstance(mmd, Modulemd.ModuleStream)
|
||||
|
||||
|
||||
@mock.patch("module_build_service.common.scm.SCM")
|
||||
def test_fetch_mmd_packager_v3(mocked_scm):
|
||||
""" Test PackagerV3 behavior for fetch_mmd """
|
||||
|
||||
FakeSCM(
|
||||
mocked_scm,
|
||||
"foo",
|
||||
"v3/mmd_packager.yaml",
|
||||
"620ec77321b2ea7b0d67d82992dda3e1d67055b4")
|
||||
|
||||
mmd, scm = fetch_mmd('testurl')
|
||||
assert not isinstance(mmd, Modulemd.ModuleStream)
|
||||
|
||||
Reference in New Issue
Block a user