本文整理汇总了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()
示例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)
示例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)
示例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')