本文整理汇总了Python中validator.errorbundler.ErrorBundle.tier方法的典型用法代码示例。如果您正苦于以下问题:Python ErrorBundle.tier方法的具体用法?Python ErrorBundle.tier怎么用?Python ErrorBundle.tier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类validator.errorbundler.ErrorBundle
的用法示例。
在下文中一共展示了ErrorBundle.tier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_json
# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import tier [as 别名]
def test_json():
"Tests the JSON output capability of the error bundler."
# Use the StringIO as an output buffer.
bundle = ErrorBundle() # No color since no output
bundle.set_type(4)
bundle.tier = 3
bundle.error((), "error", "description")
bundle.warning((), "warning", "description")
bundle.notice((), "notice", "description")
results = json.loads(bundle.render_json())
print results
assert len(results["messages"]) == 3
assert results["detected_type"] == 'langpack'
assert not results["success"]
assert results["ending_tier"] == 3