本文整理汇总了Python中kiwi.system.uri.Uri.runtime_config方法的典型用法代码示例。如果您正苦于以下问题:Python Uri.runtime_config方法的具体用法?Python Uri.runtime_config怎么用?Python Uri.runtime_config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.system.uri.Uri
的用法示例。
在下文中一共展示了Uri.runtime_config方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_translate_obs_project
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import runtime_config [as 别名]
def test_translate_obs_project(self, mock_request_get):
uri = Uri('obs://openSUSE:Leap:42.2/standard', 'yast2')
uri.runtime_config = self.runtime_config
uri.translate()
mock_request_get.assert_called_once_with(
'obs_server/openSUSE:/Leap:/42.2/standard'
)
示例2: test_translate_obs_uri_inside_buildservice
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import runtime_config [as 别名]
def test_translate_obs_uri_inside_buildservice(
self, mock_buildservice, mock_warn
):
mock_buildservice.return_value = True
uri = Uri('obs://openSUSE:Leap:42.2/standard', 'rpm-md')
uri.runtime_config = self.runtime_config
assert uri.translate(False) == \
'obs_server/openSUSE:/Leap:/42.2/standard'
assert mock_warn.called
示例3: test_is_public
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import runtime_config [as 别名]
def test_is_public(self, mock_request):
uri = Uri('xxx', 'rpm-md')
assert uri.is_public() is False
uri = Uri('https://example.com', 'rpm-md')
assert uri.is_public() is True
uri = Uri('obs://openSUSE:Leap:42.2/standard', 'yast2')
self.runtime_config.is_obs_public = mock.Mock(
return_value=False
)
uri.runtime_config = self.runtime_config
assert uri.is_public() is False
示例4: test_translate_obs_uri_not_found
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import runtime_config [as 别名]
def test_translate_obs_uri_not_found(mock_request_get, self):
mock_request_get.side_effect = Exception
uri = Uri('obs://openSUSE:Leap:42.2/standard', 'yast2')
uri.runtime_config = self.runtime_config
assert uri.translate()