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


Python ErrorBundle.overrides方法代码示例

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


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

示例1: _run_test_raw

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import overrides [as 别名]
def _run_test_raw(data, failure=True, detected_type=0, listed=True,
                  overrides=None, compat=False):
    "Runs a test on an install.rdf snippet"

    data = data.strip()

    err = ErrorBundle()
    err.detected_type = detected_type
    err.save_resource("listed", listed)
    err.overrides = overrides

    if compat:
        err.save_resource("is_compat_test", True)

    err.save_resource("has_install_rdf", True)
    err.save_resource("install_rdf", RDFParser(err, data))
    installrdf.test_install_rdf_params(err)

    print err.print_summary(verbose=True)

    if failure:  # pragma: no cover
        assert err.failed() or err.notices
    else:
        assert not err.failed() and not err.notices

    return err
开发者ID:arcticlab,项目名称:amo-validator,代码行数:28,代码来源:test_installrdf.py

示例2: _do_test_raw

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import overrides [as 别名]
def _do_test_raw(rdf, listed=True, overrides=None):
    err = ErrorBundle(listed=listed)
    err.overrides = overrides
    rdf = RDFParser(err, rdf.strip())
    err.save_resource('has_install_rdf', True)
    err.save_resource('install_rdf', rdf)

    targetapp.test_targetedapplications(err)
    return err
开发者ID:AutomatedTester,项目名称:amo-validator,代码行数:11,代码来源:test_targetapplication.py

示例3: _do_test_raw

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import overrides [as 别名]
def _do_test_raw(rdf, listed=True, overrides=None):
    err = ErrorBundle(listed=listed)
    err.overrides = overrides
    rdf = RDFParser(rdf.strip())
    err.save_resource("has_install_rdf", True)
    err.save_resource("install_rdf", rdf)

    targetapp.test_targetedapplications(err)
    print err.print_summary()
    return err
开发者ID:andymckay,项目名称:amo-validator,代码行数:12,代码来源:test_targetapplication.py

示例4: validate

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import overrides [as 别名]
def validate(path, format="json",
             approved_applications=os.path.join(os.path.dirname(__file__),
                                                "app_versions.json"),
             determined=True,
             spidermonkey=False,
             listed=True,
             expectation=PACKAGE_ANY,
             for_appversions=None,
             overrides=None):
    """
    Perform validation in one easy step!

    format : The format to output the results in
    approved_applications : Path to the list of approved application versions
    determined : Whether the validator should continue after a tier fails
    spidermonkey : Path to the local spidermonkey installation (Default: False)
    listed : True if the add-on is destined for AMO, false if not
    expectation : The type of package that should be expected
    for_appversions : A dict of app GUIDs referencing lists of versions.
                      Determines which version-dependant tests should be run.
    """

    # Load up the target applications
    apps = json.load(open(approved_applications))
    validator.constants.APPROVED_APPLICATIONS.clear()
    validator.constants.APPROVED_APPLICATIONS.update(apps)

    bundle = ErrorBundle(listed=listed, determined=determined)
    if overrides:
        bundle.overrides = overrides
    if spidermonkey != False:
        bundle.save_resource("SPIDERMONKEY", spidermonkey)

    validator.submain.prepare_package(bundle, path, expectation,
                                      for_appversions=for_appversions)

    # Write the results to the pipe
    formats = {"json": lambda b: b.render_json()}
    if format is not None:
        return formats[format](bundle)
    else:
        return bundle
开发者ID:clouserw,项目名称:amo-validator,代码行数:44,代码来源:validate.py

示例5: _run_test_raw

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import overrides [as 别名]
def _run_test_raw(data, failure=True, detected_type=0, listed=True,
                  overrides=None):
    "Runs a test on an install.rdf snippet"

    data = data.strip()

    err = ErrorBundle()
    err.detected_type = detected_type
    err.save_resource("listed", listed)
    err.overrides = overrides

    parser = RDFParser(data)
    installrdf._test_rdf(err, parser)

    print err.print_summary(verbose=True)

    if failure: # pragma: no cover
        assert err.failed() or err.notices
    else:
        assert not err.failed() and not err.notices

    return err
开发者ID:andymckay,项目名称:amo-validator,代码行数:24,代码来源:test_installrdf.py


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