本文整理汇总了Python中manifestparser.ManifestParser.populate_directory_manifests方法的典型用法代码示例。如果您正苦于以下问题:Python ManifestParser.populate_directory_manifests方法的具体用法?Python ManifestParser.populate_directory_manifests怎么用?Python ManifestParser.populate_directory_manifests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manifestparser.ManifestParser
的用法示例。
在下文中一共展示了ManifestParser.populate_directory_manifests方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_manifest_ignore
# 需要导入模块: from manifestparser import ManifestParser [as 别名]
# 或者: from manifestparser.ManifestParser import populate_directory_manifests [as 别名]
def test_manifest_ignore(self):
"""test manifest `ignore` parameter for ignoring directories"""
stub = self.create_stub()
try:
ManifestParser.populate_directory_manifests([stub], filename="manifest.ini", ignore=("subdir",))
parser = ManifestParser()
parser.read(os.path.join(stub, "manifest.ini"))
self.assertEqual([i["name"] for i in parser.tests], ["bar", "fleem", "foo"])
self.assertFalse(os.path.exists(os.path.join(stub, "subdir", "manifest.ini")))
except:
raise
finally:
shutil.rmtree(stub)
示例2: test_manifest_ignore
# 需要导入模块: from manifestparser import ManifestParser [as 别名]
# 或者: from manifestparser.ManifestParser import populate_directory_manifests [as 别名]
def test_manifest_ignore(self):
"""test manifest `ignore` parameter for ignoring directories"""
stub = self.create_stub()
try:
ManifestParser.populate_directory_manifests([stub], filename='manifest.ini', ignore=('subdir',))
parser = ManifestParser()
parser.read(os.path.join(stub, 'manifest.ini'))
self.assertEqual([i['name'] for i in parser.tests],
['bar', 'fleem', 'foo'])
self.assertFalse(os.path.exists(os.path.join(stub, 'subdir', 'manifest.ini')))
except:
raise
finally:
shutil.rmtree(stub)
示例3: test_convert_directory_manifests_in_place
# 需要导入模块: from manifestparser import ManifestParser [as 别名]
# 或者: from manifestparser.ManifestParser import populate_directory_manifests [as 别名]
def test_convert_directory_manifests_in_place(self):
"""
keep the manifests in place
"""
stub = self.create_stub()
try:
ManifestParser.populate_directory_manifests([stub], filename="manifest.ini")
self.assertEqual(sorted(os.listdir(stub)), ["bar", "fleem", "foo", "manifest.ini", "subdir"])
parser = ManifestParser()
parser.read(os.path.join(stub, "manifest.ini"))
self.assertEqual([i["name"] for i in parser.tests], ["subfile", "bar", "fleem", "foo"])
parser = ManifestParser()
parser.read(os.path.join(stub, "subdir", "manifest.ini"))
self.assertEqual(len(parser.tests), 1)
self.assertEqual(parser.tests[0]["name"], "subfile")
except:
raise
finally:
shutil.rmtree(stub)
示例4: test_convert_directory_manifests_in_place
# 需要导入模块: from manifestparser import ManifestParser [as 别名]
# 或者: from manifestparser.ManifestParser import populate_directory_manifests [as 别名]
def test_convert_directory_manifests_in_place(self):
"""
keep the manifests in place
"""
stub = self.create_stub()
try:
ManifestParser.populate_directory_manifests([stub], filename='manifest.ini')
self.assertEqual(sorted(os.listdir(stub)),
['bar', 'fleem', 'foo', 'manifest.ini', 'subdir'])
parser = ManifestParser()
parser.read(os.path.join(stub, 'manifest.ini'))
self.assertEqual([i['name'] for i in parser.tests],
['subfile', 'bar', 'fleem', 'foo'])
parser = ManifestParser()
parser.read(os.path.join(stub, 'subdir', 'manifest.ini'))
self.assertEqual(len(parser.tests), 1)
self.assertEqual(parser.tests[0]['name'], 'subfile')
except:
raise
finally:
shutil.rmtree(stub)