Optionally, block building modules with EOL streams.

Requested by @mboddu in:

- https://pagure.io/fm-orchestrator/issue/960
- https://pagure.io/modularity/issue/102
This commit is contained in:
Ralph Bean
2018-08-31 15:23:04 -04:00
parent 1077f11b2a
commit 0aff640ef3
5 changed files with 83 additions and 0 deletions

View File

@@ -551,6 +551,34 @@ class TestUtils:
expected_tag = 'module-1cf457d452e54dda'
assert tag == expected_tag
@patch("module_build_service.utils.submit.requests")
def test_pdc_eol_check(self, requests):
""" Push mock pdc responses through the eol check function. """
response = mock.Mock()
response.json.return_value = {"results": [{
"id": 347907,
"global_component": "mariadb",
"name": "10.1",
"slas": [{
"id": 694207,
"sla": "security_fixes",
"eol": "2019-12-01",
}],
"type": "module",
"active": True,
"critical_path": False,
}]}
requests.get.return_value = response
is_eol = module_build_service.utils.submit._is_eol_in_pdc('mariadb', '10.1')
assert not is_eol
response.json.return_value["results"][0]["active"] = False
is_eol = module_build_service.utils.submit._is_eol_in_pdc('mariadb', '10.1')
assert is_eol
class DummyModuleBuilder(GenericBuilder):
"""