本文整理匯總了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)