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


Python processor.fetch_sourcemap函数代码示例

本文整理汇总了Python中sentry.lang.javascript.processor.fetch_sourcemap函数的典型用法代码示例。如果您正苦于以下问题:Python fetch_sourcemap函数的具体用法?Python fetch_sourcemap怎么用?Python fetch_sourcemap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: test_garbage_json

    def test_garbage_json(self):
        responses.add(
            responses.GET, 'http://example.com', body='xxxx', content_type='application/json'
        )

        with pytest.raises(UnparseableSourcemap):
            fetch_sourcemap('http://example.com')
开发者ID:binlee1990,项目名称:sentry,代码行数:7,代码来源:test_processor.py

示例2: test_simple_non_utf8

    def test_simple_non_utf8(self):
        responses.add(responses.GET, 'http://example.com', body='{}',
                      content_type='application/json; charset=NOPE')

        with pytest.raises(CannotFetchSource) as exc:
            fetch_sourcemap('http://example.com')

        assert exc.value.data['type'] == EventError.JS_INVALID_SOURCE_ENCODING
开发者ID:pythorn,项目名称:sentry,代码行数:8,代码来源:test_processor.py

示例3: test_base64_without_padding

    def test_base64_without_padding(self):
        smap_view = fetch_sourcemap(base64_sourcemap.rstrip('='))
        tokens = [Token(1, 0, '/test.js', 0, 0, 0, None)]

        assert list(smap_view) == tokens
        assert smap_view.get_source_contents(0) == 'console.log("hello, World!")'
        assert smap_view.get_source_name(0) == u'/test.js'
开发者ID:pythorn,项目名称:sentry,代码行数:7,代码来源:test_processor.py

示例4: test_simple_base64

    def test_simple_base64(self):
        smap_view = fetch_sourcemap(base64_sourcemap)
        tokens = [Token(1, 0, '/test.js', 0, 0, 0, None)]

        assert list(smap_view) == tokens
        assert smap_view.get_source_contents(0) == 'console.log("hello, World!")'
        assert smap_view.get_source_name(0) == u'/test.js'
开发者ID:pythorn,项目名称:sentry,代码行数:7,代码来源:test_processor.py

示例5: test_simple

    def test_simple(self):
        index = fetch_sourcemap(base64_sourcemap)
        states = [SourceMap(1, 0, '/test.js', 0, 0, None)]
        sources = set(['/test.js'])
        keys = [(1, 0)]
        content = {'/test.js': ['console.log("hello, World!")']}

        assert index == SourceMapIndex(states, keys, sources, content)
开发者ID:DZTPY,项目名称:sentry,代码行数:8,代码来源:test_processor.py

示例6: test_base64_without_padding

    def test_base64_without_padding(self):
        smap_view = fetch_sourcemap(base64_sourcemap.rstrip('='))
        tokens = [SourceMapTokenMatch(0, 0, 1, 0, src='/test.js', src_id=0)]

        assert list(smap_view) == tokens
        sv = smap_view.get_sourceview(0)
        assert sv.get_source() == u'console.log("hello, World!")'
        assert smap_view.get_source_name(0) == u'/test.js'
开发者ID:binlee1990,项目名称:sentry,代码行数:8,代码来源:test_processor.py

示例7: test_broken_base64

 def test_broken_base64(self):
     with pytest.raises(UnparseableSourcemap):
         fetch_sourcemap('data:application/json;base64,xxx')
开发者ID:pythorn,项目名称:sentry,代码行数:3,代码来源:test_processor.py


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