本文整理匯總了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')