本文整理汇总了Python中atomicapp.nulecule.base.NuleculeComponent._get_artifact_paths_for_path方法的典型用法代码示例。如果您正苦于以下问题:Python NuleculeComponent._get_artifact_paths_for_path方法的具体用法?Python NuleculeComponent._get_artifact_paths_for_path怎么用?Python NuleculeComponent._get_artifact_paths_for_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atomicapp.nulecule.base.NuleculeComponent
的用法示例。
在下文中一共展示了NuleculeComponent._get_artifact_paths_for_path方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_file_path
# 需要导入模块: from atomicapp.nulecule.base import NuleculeComponent [as 别名]
# 或者: from atomicapp.nulecule.base.NuleculeComponent import _get_artifact_paths_for_path [as 别名]
def test_file_path(self, mock_os_path_isfile):
mock_os_path_isfile.return_value = True
nc = NuleculeComponent('some-name', 'some/path')
self.assertEqual(
nc._get_artifact_paths_for_path('some/path/to/file'),
['some/path/to/file'])
示例2: test_dir_path
# 需要导入模块: from atomicapp.nulecule.base import NuleculeComponent [as 别名]
# 或者: from atomicapp.nulecule.base.NuleculeComponent import _get_artifact_paths_for_path [as 别名]
def test_dir_path(self, mock_os_path_isfile, mock_os_path_isdir,
mock_os_listdir):
mock_os_path_isfile.return_value = False
mock_os_path_isdir.side_effect = lambda path: True if path.endswith('dir') else False
mock_os_listdir.return_value = [
'.foo',
'some-dir',
'file1',
'file2'
]
nc = NuleculeComponent('some-name', 'some/path')
self.assertEqual(
nc._get_artifact_paths_for_path('artifacts-dir'),
['artifacts-dir/file1', 'artifacts-dir/file2'])