本文整理汇总了Python中distutils.filelist.findall方法的典型用法代码示例。如果您正苦于以下问题:Python filelist.findall方法的具体用法?Python filelist.findall怎么用?Python filelist.findall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.filelist
的用法示例。
在下文中一共展示了filelist.findall方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_missing_symlink
# 需要导入模块: from distutils import filelist [as 别名]
# 或者: from distutils.filelist import findall [as 别名]
def test_missing_symlink(self):
with test.support.temp_cwd():
os.symlink('foo', 'bar')
self.assertEqual(filelist.findall(), [])
示例2: test_basic_discovery
# 需要导入模块: from distutils import filelist [as 别名]
# 或者: from distutils.filelist import findall [as 别名]
def test_basic_discovery(self):
"""
When findall is called with no parameters or with
'.' as the parameter, the dot should be omitted from
the results.
"""
with test.support.temp_cwd():
os.mkdir('foo')
file1 = os.path.join('foo', 'file1.txt')
test.support.create_empty_file(file1)
os.mkdir('bar')
file2 = os.path.join('bar', 'file2.txt')
test.support.create_empty_file(file2)
expected = [file2, file1]
self.assertEqual(sorted(filelist.findall()), expected)
示例3: test_non_local_discovery
# 需要导入模块: from distutils import filelist [as 别名]
# 或者: from distutils.filelist import findall [as 别名]
def test_non_local_discovery(self):
"""
When findall is called with another path, the full
path name should be returned.
"""
with test.support.temp_dir() as temp_dir:
file1 = os.path.join(temp_dir, 'file1.txt')
test.support.create_empty_file(file1)
expected = [file1]
self.assertEqual(filelist.findall(temp_dir), expected)