def run(testapp, collections=None):
app = testapp.app
root = app.root_factory(app)
if not collections:
collections = root.by_item_type.keys()
check_path(testapp, '/')
for collection_name in collections:
collection = root[collection_name]
collection_path = resource_path(collection, '')
check_path(testapp, collection_path)
failed = 0
for count, item in enumerate(itervalues(collection)):
path = resource_path(item, '')
if not check_path(testapp, path):
failed += 1
if failed:
logger.info('Collection %s: %d of %d failed to render.',
collection_path, failed, count)
else:
logger.info('Collection %s: all %d rendered ok',
collection_path, count)
评论列表
文章目录