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