當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。