当前位置: 首页>>代码示例>>Python>>正文


Python HostRpmBuilder._build_rpm_using_rpmbuild方法代码示例

本文整理汇总了Python中config_rpm_maker.hostrpmbuilder.HostRpmBuilder._build_rpm_using_rpmbuild方法的典型用法代码示例。如果您正苦于以下问题:Python HostRpmBuilder._build_rpm_using_rpmbuild方法的具体用法?Python HostRpmBuilder._build_rpm_using_rpmbuild怎么用?Python HostRpmBuilder._build_rpm_using_rpmbuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在config_rpm_maker.hostrpmbuilder.HostRpmBuilder的用法示例。


在下文中一共展示了HostRpmBuilder._build_rpm_using_rpmbuild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_should_tar_sources_before_building_rpm

# 需要导入模块: from config_rpm_maker.hostrpmbuilder import HostRpmBuilder [as 别名]
# 或者: from config_rpm_maker.hostrpmbuilder.HostRpmBuilder import _build_rpm_using_rpmbuild [as 别名]
    def test_should_tar_sources_before_building_rpm(self, mock_environ, mock_abspath, mock_popen, mock_config):

        mock_popen.return_value = self.mock_process

        HostRpmBuilder._build_rpm_using_rpmbuild(self.mock_host_rpm_builder)

        self.mock_host_rpm_builder._tar_sources.assert_called_with()
开发者ID:yadt,项目名称:yadt-config-rpm-maker,代码行数:9,代码来源:hostrpmbuilder_test.py

示例2: test_should_not_write_stderr_to_logger_when_not_given

# 需要导入模块: from config_rpm_maker.hostrpmbuilder import HostRpmBuilder [as 别名]
# 或者: from config_rpm_maker.hostrpmbuilder.HostRpmBuilder import _build_rpm_using_rpmbuild [as 别名]
    def test_should_not_write_stderr_to_logger_when_not_given(self, mock_environ, mock_abspath, mock_popen, mock_config):

        mock_logger = Mock()
        self.mock_host_rpm_builder.logger = mock_logger
        self.mock_process.communicate.return_value = ('stdout', "")
        mock_popen.return_value = self.mock_process

        HostRpmBuilder._build_rpm_using_rpmbuild(self.mock_host_rpm_builder)

        self.assert_mock_never_called(mock_logger.error)
开发者ID:yadt,项目名称:yadt-config-rpm-maker,代码行数:12,代码来源:hostrpmbuilder_test.py

示例3: test_should_call_rpmbuild

# 需要导入模块: from config_rpm_maker.hostrpmbuilder import HostRpmBuilder [as 别名]
# 或者: from config_rpm_maker.hostrpmbuilder.HostRpmBuilder import _build_rpm_using_rpmbuild [as 别名]
    def test_should_call_rpmbuild(self, mock_environ, mock_abspath, mock_popen, mock_config):

        mock_popen.return_value = self.mock_process

        mock_environment_copy = {}
        mock_environ.copy.return_value = mock_environment_copy

        def fake_abspath(directory):
            return '/absolute' + directory

        mock_abspath.side_effect = fake_abspath

        HostRpmBuilder._build_rpm_using_rpmbuild(self.mock_host_rpm_builder)

        mock_popen.assert_called_withPopen("rpmbuild --define --clean '_topdir /absolute/path/to/rpm/build/directory' -ta /path/to/tarred_sources.tar.gz", shell=True, env=mock_environment_copy, stderr=PIPE, stdout=PIPE)
开发者ID:yadt,项目名称:yadt-config-rpm-maker,代码行数:17,代码来源:hostrpmbuilder_test.py

示例4: test_should_write_stderr_to_logger

# 需要导入模块: from config_rpm_maker.hostrpmbuilder import HostRpmBuilder [as 别名]
# 或者: from config_rpm_maker.hostrpmbuilder.HostRpmBuilder import _build_rpm_using_rpmbuild [as 别名]
    def test_should_write_stderr_to_logger(self, mock_environ, mock_abspath, mock_popen, mock_config):

        mock_logger = Mock()
        self.mock_host_rpm_builder.logger = mock_logger

        mock_popen.return_value = self.mock_process

        mock_environment_copy = {}
        mock_environ.copy.return_value = mock_environment_copy

        def fake_abspath(directory):
            return '/absolute' + directory

        mock_abspath.side_effect = fake_abspath

        HostRpmBuilder._build_rpm_using_rpmbuild(self.mock_host_rpm_builder)

        mock_logger.error.assert_called_with('stderr')
开发者ID:yadt,项目名称:yadt-config-rpm-maker,代码行数:20,代码来源:hostrpmbuilder_test.py


注:本文中的config_rpm_maker.hostrpmbuilder.HostRpmBuilder._build_rpm_using_rpmbuild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。