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


Python ErrorBundle.metadata['is_jetpack']方法代码示例

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


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

示例1: _do_real_test_raw

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import metadata['is_jetpack'] [as 别名]
def _do_real_test_raw(script, path='foo.js', versions=None, detected_type=None,
                      metadata=None, resources=None, jetpack=False):
    """Perform a JS test using a non-mock bundler."""

    err = ErrorBundle(for_appversions=versions or {})
    if detected_type:
        err.detected_type = detected_type
    if metadata is not None:
        err.metadata = metadata
    if resources is not None:
        err.resources = resources
    if jetpack:
        err.metadata['is_jetpack'] = True

    validator.testcases.content._process_file(err, MockXPI(), path, script,
                                              path.lower())
    return err
开发者ID:diox,项目名称:amo-validator,代码行数:19,代码来源:js_helper.py

示例2: test_absolute_uris_in_markup

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import metadata['is_jetpack'] [as 别名]
def test_absolute_uris_in_markup():
    """
    Test that a warning is thrown for absolute URIs within markup files.
    """

    err = ErrorBundle()
    bad_html = '<foo><bar src="resource://foo-data/bar/zap.png" /></foo>'

    parser = MarkupParser(err)
    parser.process('foo.html', bad_html, 'html')
    assert not err.failed()

    err.metadata['is_jetpack'] = True
    parser = MarkupParser(err)
    parser.process('foo.html', bad_html, 'html')
    assert err.failed()
    assert err.compat_summary['errors']
开发者ID:kewisch,项目名称:amo-validator,代码行数:19,代码来源:test_jetpack.py

示例3: _do_test_raw

# 需要导入模块: from validator.errorbundler import ErrorBundle [as 别名]
# 或者: from validator.errorbundler.ErrorBundle import metadata['is_jetpack'] [as 别名]
def _do_test_raw(script, path='foo.js', bootstrap=False, ignore_pollution=True,
                 detected_type=None, jetpack=False, instant=True):
    """Perform a test on a JS file."""

    err = ErrorBundle(instant=instant)
    if jetpack:
        err.metadata['is_jetpack'] = True

    err.handler = OutputHandler(sys.stdout, True)
    err.supported_versions = {}
    if bootstrap:
        err.save_resource('em:bootstrap', True)
    if detected_type:
        err.detected_type = detected_type

    validator.testcases.content._process_file(
        err, MockXPI(), path, script, path.lower(), not ignore_pollution)
    if err.final_context is not None:
        print 'CONTEXT', repr(err.final_context.keys())

    return err
开发者ID:kmaglione,项目名称:amo-validator,代码行数:23,代码来源:js_helper.py


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