本文整理汇总了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')
示例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
示例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'
示例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'
示例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)
示例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'
示例7: test_broken_base64
def test_broken_base64(self):
with pytest.raises(UnparseableSourcemap):
fetch_sourcemap('data:application/json;base64,xxx')