当前位置: 首页>>代码示例>>Python>>正文


Python ErrorBundle.set_tier方法代码示例

本文整理汇总了Python中validator.errorbundler.ErrorBundle.set_tier方法的典型用法代码示例。如果您正苦于以下问题:Python ErrorBundle.set_tier方法的具体用法?Python ErrorBundle.set_tier怎么用?Python ErrorBundle.set_tier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在validator.errorbundler.ErrorBundle的用法示例。


在下文中一共展示了ErrorBundle.set_tier方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_xpi_tiererror

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import set_tier [as 别名]
def test_xpi_tiererror():
    'Tests that tiers are reset when a subpackage is encountered'

    err = ErrorBundle()
    mock_package = MockXPI(
        {'foo.xpi': 'tests/resources/content/subpackage.jar'})

    err.set_tier(2)
    content.test_packed_packages(err, mock_package)
    assert err.errors[0]['tier'] == 1
    assert err.tier == 2
    assert all(x == 1 for x in content.testendpoint_validator.found_tiers)
开发者ID:AutomatedTester,项目名称:amo-validator,代码行数:14,代码来源:test_content.py

示例2: test_xpi_tiererror

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import set_tier [as 别名]
def test_xpi_tiererror():
    "Tests that tiers are reset when a subpackage is encountered"

    err = ErrorBundle()
    mock_package = MockXPI(
        {"foo.xpi": "tests/resources/content/subpackage.jar"})

    err.set_tier(2)
    result = content.test_packed_packages(err, mock_package)
    assert err.errors[0]["tier"] == 1
    assert err.tier == 2
    assert all(x == 1 for x in content.testendpoint_validator.found_tiers)
开发者ID:l-hedgehog,项目名称:amo-validator,代码行数:14,代码来源:test_content.py

示例3: test_json

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import set_tier [as 别名]
def test_json():
    """Test the JSON output capability of the error bundler."""

    # Use the StringIO as an output buffer.
    bundle = ErrorBundle()
    bundle.detected_type = 4
    bundle.set_tier(4)
    bundle.set_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"] == 4
开发者ID:kmaglione,项目名称:amo-validator,代码行数:23,代码来源:test_errorbundler.py

示例4: test_json

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import set_tier [as 别名]
def test_json():
    """Test the JSON output capability of the error bundler."""

    # Use the StringIO as an output buffer.
    bundle = ErrorBundle()  # No color since no output
    bundle.detected_type = 4
    bundle.set_tier(4)
    bundle.set_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'] == 4
开发者ID:AutomatedTester,项目名称:amo-validator,代码行数:23,代码来源:test_errorbundler.py


注:本文中的validator.errorbundler.ErrorBundle.set_tier方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。