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


Python Defaults.project_file方法代码示例

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


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

示例1: test_import_description_archive_from_derived

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import project_file [as 别名]
    def test_import_description_archive_from_derived(
        self, mock_path, mock_open, mock_command
    ):
        path_return_values = [
            True, False, True, True, True, True, True
        ]

        def side_effect(arg):
            return path_return_values.pop()

        mock_path.side_effect = side_effect
        self.setup_with_real_xml.import_description()

        assert mock_command.call_args_list == [
            call(['mkdir', '-p', 'root_dir/image']),
            call(['cp', '../data/config.sh', 'root_dir/image/config.sh']),
            call([
                'cp', '../data/my_edit_boot_script',
                'root_dir/image/edit_boot_config.sh'
            ]),
            call([
                'cp', '/absolute/path/to/my_edit_boot_install',
                'root_dir/image/edit_boot_install.sh'
            ]),
            call(['cp', '../data/images.sh', 'root_dir/image/images.sh']),
            call([
                'cp', Defaults.project_file('config/functions.sh'),
                'root_dir/.kconfig'
            ]),
            call(['cp', '/absolute/path/to/image.tgz', 'root_dir/image/']),
            call([
                'cp', 'derived/description/bootstrap.tgz', 'root_dir/image/'
            ])
        ]
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:36,代码来源:system_setup_test.py

示例2: test_import_description

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import project_file [as 别名]
    def test_import_description(
        self, mock_iglob, mock_path, mock_open, mock_command
    ):
        mock_iglob.return_value = ['config-cdroot.tar.xz']
        mock_path.return_value = True
        self.setup_with_real_xml.import_description()

        mock_iglob.assert_called_once_with(
            '../data/config-cdroot.tar*'
        )
        assert mock_command.call_args_list == [
            call(['mkdir', '-p', 'root_dir/image']),
            call(['cp', '../data/config.sh', 'root_dir/image/config.sh']),
            call([
                'cp', '../data/my_edit_boot_script',
                'root_dir/image/edit_boot_config.sh'
            ]),
            call([
                'cp', '/absolute/path/to/my_edit_boot_install',
                'root_dir/image/edit_boot_install.sh'
            ]),
            call(['cp', '../data/images.sh', 'root_dir/image/images.sh']),
            call([
                'cp', Defaults.project_file('config/functions.sh'),
                'root_dir/.kconfig'
            ]),
            call(['cp', '/absolute/path/to/image.tgz', 'root_dir/image/']),
            call(['cp', '../data/bootstrap.tgz', 'root_dir/image/']),
            call(['cp', 'config-cdroot.tar.xz', 'root_dir/image/'])
        ]
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:32,代码来源:system_setup_test.py

示例3: test_run_common_function

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import project_file [as 别名]
 def test_run_common_function(self, mock_command):
     Shell.run_common_function('foo', ['"param1"', '"param2"'])
     command_string = ' '.join(
         [
             'source', Defaults.project_file('config/functions.sh') + ';',
             'foo', '"param1"', '"param2"'
         ]
     )
     mock_command.assert_called_once_with(
         ['bash', '-c', command_string]
     )
开发者ID:SUSE,项目名称:kiwi,代码行数:13,代码来源:shell_test.py

示例4: test_import_description

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import project_file [as 别名]
 def test_import_description(self, mock_path, mock_open, mock_command):
     mock_path.return_value = True
     self.setup_with_real_xml.import_description()
     assert mock_command.call_args_list == [
         call(['mkdir', '-p', 'root_dir/image']),
         call([
             'cp', 'description_dir/my_edit_boot_script',
             'root_dir/image/edit_boot_config.sh'
         ]),
         call([
             'cp', 'description_dir/my_edit_boot_install',
             'root_dir/image/edit_boot_install.sh'
         ]),
         call(['cp', 'description_dir/config.sh', 'root_dir/image/']),
         call(['cp', 'description_dir/images.sh', 'root_dir/image/']),
         call([
             'cp', Defaults.project_file('config/functions.sh'),
             'root_dir/.kconfig'
         ])
     ]
开发者ID:k0da,项目名称:kiwi-1,代码行数:22,代码来源:system_setup_test.py

示例5: test_run_common_function

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import project_file [as 别名]
 def test_run_common_function(self, mock_command):
     Shell.run_common_function("foo", ['"param1"', '"param2"'])
     command_string = " ".join(
         ["source", Defaults.project_file("config/functions.sh") + ";", "foo", '"param1"', '"param2"']
     )
     mock_command.assert_called_once_with(["bash", "-c", command_string])
开发者ID:ChrisBr,项目名称:kiwi,代码行数:8,代码来源:shell_test.py


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