• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python stacktrace.Frame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_context_with_nan

 def test_context_with_nan(self):
     self.assertEquals(
         Frame.to_python({
             'filename': 'x',
             'vars': {
                 'x': float('inf')
             },
         }).vars,
         {'x': '<inf>'},
     )
     self.assertEquals(
         Frame.to_python({
             'filename': 'x',
             'vars': {
                 'x': float('-inf')
             },
         }).vars,
         {'x': '<-inf>'},
     )
     self.assertEquals(
         Frame.to_python({
             'filename': 'x',
             'vars': {
                 'x': float('nan')
             },
         }).vars,
         {'x': '<nan>'},
     )
开发者ID:alshopov,项目名称:sentry,代码行数:28,代码来源:test_stacktrace.py


示例2: test_get_hash_sanitizes_versioned_filenames

    def test_get_hash_sanitizes_versioned_filenames(self):
        # This is Ruby specific
        interface = Frame.to_python(
            {
                'filename': '/data/foo/releases/20140114151955/app/views/foo.html.erb',
                'context_line': '<% if @hotels.size > 0 %>',
            }
        )
        result = interface.get_hash()
        self.assertEquals(
            result, [
                '/data/foo/releases/<version>/app/views/foo.html.erb',
                '<% if @hotels.size > 0 %>',
            ]
        )

        interface = Frame.to_python(
            {
                'filename': '20140114151955/app/views/foo.html.erb',
                'context_line': '<% if @hotels.size > 0 %>',
            }
        )
        result = interface.get_hash()
        self.assertEquals(
            result, [
                '<version>/app/views/foo.html.erb',
                '<% if @hotels.size > 0 %>',
            ]
        )
开发者ID:alshopov,项目名称:sentry,代码行数:29,代码来源:test_stacktrace.py


示例3: test_get_hash_ignores_filename_if_https

 def test_get_hash_ignores_filename_if_https(self):
     interface = Frame.to_python({
         'context_line': 'hello world',
         'filename': 'https://foo.com/foo.py',
     })
     result = interface.get_hash()
     self.assertEquals(result, ['hello world'])
开发者ID:sk163,项目名称:sentry,代码行数:7,代码来源:test_stacktrace.py


示例4: test_get_hash_with_only_required_vars

 def test_get_hash_with_only_required_vars(self):
     interface = Frame.to_python({
         'lineno': 1,
         'filename': 'foo.py',
     })
     result = interface.get_hash()
     self.assertEquals(result, ['foo.py', 1])
开发者ID:Akashguharoy,项目名称:sentry,代码行数:7,代码来源:test_stacktrace.py


示例5: test_get_hash_sanitizes_erb_templates

 def test_get_hash_sanitizes_erb_templates(self):
     # This is Ruby specific
     interface = Frame.to_python(
         {"filename": "foo.html.erb", "function": "_foo_html_erb__3327151541118998292_70361296749460"}
     )
     result = interface.get_hash()
     self.assertEquals(result, ["foo.html.erb", "_foo_html_erb__<anon>_<anon>"])
开发者ID:songyi199111,项目名称:sentry,代码行数:7,代码来源:test_stacktrace.py


示例6: test_get_hash_sanitizes_versioned_filenames

    def test_get_hash_sanitizes_versioned_filenames(self):
        # This is Ruby specific
        interface = Frame.to_python(
            {
                "filename": "/data/foo/releases/20140114151955/app/views/foo.html.erb",
                "context_line": "<% if @hotels.size > 0 %>",
            }
        )
        result = interface.get_hash()
        self.assertEquals(result, ["/data/foo/releases/<version>/app/views/foo.html.erb", "<% if @hotels.size > 0 %>"])

        interface = Frame.to_python(
            {"filename": "20140114151955/app/views/foo.html.erb", "context_line": "<% if @hotels.size > 0 %>"}
        )
        result = interface.get_hash()
        self.assertEquals(result, ["<version>/app/views/foo.html.erb", "<% if @hotels.size > 0 %>"])
开发者ID:songyi199111,项目名称:sentry,代码行数:16,代码来源:test_stacktrace.py


示例7: test_get_hash_uses_function_over_lineno

 def test_get_hash_uses_function_over_lineno(self):
     interface = Frame.to_python({
         'lineno': 1,
         'filename': 'foo.py',
         'function': 'bar'
     })
     result = interface.get_hash()
     self.assertEquals(result, ['foo.py', 'bar'])
开发者ID:Akashguharoy,项目名称:sentry,代码行数:8,代码来源:test_stacktrace.py


示例8: test_get_hash_uses_module_over_filename

 def test_get_hash_uses_module_over_filename(self):
     interface = Frame.to_python({
         'lineno': 1,
         'filename': 'foo.py',
         'module': 'foo'
     })
     result = interface.get_hash()
     self.assertEquals(result, ['foo', 1])
开发者ID:Akashguharoy,项目名称:sentry,代码行数:8,代码来源:test_stacktrace.py


示例9: test_get_hash_ignores_filename_if_blob

 def test_get_hash_ignores_filename_if_blob(self):
     interface = Frame.to_python(
         {
             'filename': 'blob:http://example.com/7f7aaadf-a006-4217-9ed5-5fbf8585c6c0',
         }
     )
     result = interface.get_hash()
     self.assertEquals(result, [])
开发者ID:alshopov,项目名称:sentry,代码行数:8,代码来源:test_stacktrace.py


示例10: test_get_hash_ignores_safari_native_code

 def test_get_hash_ignores_safari_native_code(self):
     interface = Frame.to_python({
         'abs_path': '[native code]',
         'filename': '[native code]',
         'function': 'forEach',
     })
     result = interface.get_hash()
     self.assertEquals(result, [])
开发者ID:duanshuaimin,项目名称:sentry,代码行数:8,代码来源:test_stacktrace.py


示例11: test_get_hash_sanitizes_block_functions

 def test_get_hash_sanitizes_block_functions(self):
     # This is Ruby specific
     interface = Frame.to_python({
         'filename': 'foo.py',
         'function': 'block in _conditional_callback_around_233',
     })
     result = interface.get_hash()
     self.assertEquals(result, ['foo.py', 'block'])
开发者ID:Akashguharoy,项目名称:sentry,代码行数:8,代码来源:test_stacktrace.py


示例12: test_get_hash_ignores_java8_lambda_module

 def test_get_hash_ignores_java8_lambda_module(self):
     interface = Frame.to_python({
         'module': 'foo.bar.Baz$$Lambda$40/1673859467',
         'function': 'call',
     })
     result = interface.get_hash()
     self.assertEquals(result, [
         '<module>',
         'call',
     ])
开发者ID:Akashguharoy,项目名称:sentry,代码行数:10,代码来源:test_stacktrace.py


示例13: test_get_hash_ignores_java8_lambda_function

 def test_get_hash_ignores_java8_lambda_function(self):
     interface = Frame.to_python({
         'module': 'foo.bar.Baz',
         'function': 'lambda$work$1',
     })
     result = interface.get_hash()
     self.assertEquals(result, [
         'foo.bar.Baz',
         '<function>',
     ])
开发者ID:Akashguharoy,项目名称:sentry,代码行数:10,代码来源:test_stacktrace.py


示例14: test_get_hash_ignores_extra_ENHANCED_clojure_classes

 def test_get_hash_ignores_extra_ENHANCED_clojure_classes(self):
     interface = Frame.to_python({
         'module': 'sentry_clojure_example.core$_main$fn__1539$fn__1540',
         'function': 'invoke'
     })
     result = interface.get_hash()
     self.assertEquals(result, [
         'sentry_clojure_example.core$_main$fn__<auto>$fn__<auto>',
         'invoke',
     ])
开发者ID:duanshuaimin,项目名称:sentry,代码行数:10,代码来源:test_stacktrace.py


示例15: test_get_hash_sanitizes_erb_templates

 def test_get_hash_sanitizes_erb_templates(self):
     # This is Ruby specific
     interface = Frame.to_python({
         'filename': 'foo.html.erb',
         'function': '_foo_html_erb__3327151541118998292_70361296749460',
     })
     result = interface.get_hash()
     self.assertEquals(result, [
         'foo.html.erb', '_foo_html_erb__<anon>_<anon>',
     ])
开发者ID:Akashguharoy,项目名称:sentry,代码行数:10,代码来源:test_stacktrace.py


示例16: test_get_hash_ignores_ENHANCED_spring_classes

 def test_get_hash_ignores_ENHANCED_spring_classes(self):
     interface = Frame.to_python({
         'module': 'invalid.gruml.talkytalkyhub.common.config.'
         'JipJipConfig$$EnhancerBySpringCGLIB$$1ebdddb0',
         'function': 'jipJipManagementApplication'
     })
     result = interface.get_hash()
     self.assertEquals(result, [
         'invalid.gruml.talkytalkyhub.common.config.JipJipConfig'
         '$$EnhancerBySpringCGLIB$$<auto>',
         'jipJipManagementApplication',
     ])
开发者ID:Akashguharoy,项目名称:sentry,代码行数:12,代码来源:test_stacktrace.py


示例17: test_get_hash_ignores_javassist

    def test_get_hash_ignores_javassist(self):
        interface = Frame.to_python(
            {
                'module': 'com.example.api.entry.EntriesResource_$$_javassist_seam_74',
                'function': 'fn',
            }
        )
        result = interface.get_hash(platform='java')
        self.assertEquals(
            result, [
                'com.example.api.entry.EntriesResource_$$_javassist<auto>', 'fn'
            ]
        )

        interface = Frame.to_python(
            {
                'module': 'com.example.api.entry.EntriesResource_$$_javassist_74',
                'function': 'fn',
            }
        )
        result = interface.get_hash(platform='java')
        self.assertEquals(
            result, [
                'com.example.api.entry.EntriesResource_$$_javassist<auto>', 'fn'
            ]
        )

        interface = Frame.to_python(
            {
                'filename': 'EntriesResource_$$_javassist_seam_74.java',
                'function': 'fn',
            }
        )
        result = interface.get_hash(platform='java')
        self.assertEquals(
            result, [
                'EntriesResource_$$_javassist<auto>.java', 'fn'
            ]
        )
开发者ID:alexandrul,项目名称:sentry,代码行数:39,代码来源:test_stacktrace.py


示例18: test_get_hash_ignores_module_if_page_url

    def test_get_hash_ignores_module_if_page_url(self):
        """
        When the abs_path is a URL without a file extension, and the module is
        a suffix of that URL, we should ignore the module. This takes care of a
        raven-js issue where page URLs (not source filenames) are being used as
        the module.
        """

        interface = Frame.to_python({
            'filename': 'foo.py',
            'abs_path': 'https://sentry.io/foo/bar/baz.js',
            'module': 'foo/bar/baz',
        })
        result = interface.get_hash(platform='javascript')
        assert result == ['foo/bar/baz']

        interface = Frame.to_python({
            'filename': 'foo.py',
            'abs_path': 'https://sentry.io/foo/bar/baz',
            'module': 'foo/bar/baz',
        })
        result = interface.get_hash(platform='javascript')
        assert result == ['<module>']
开发者ID:alexandrul,项目名称:sentry,代码行数:23,代码来源:test_stacktrace.py


示例19: format_chrome_ie_frame

    def format_chrome_ie_frame(self, frame):
        tokens = JavascriptLiteSourceProcessor.chrome_ie_stacktrace_expr.findall(frame)[0]

        frame = {
            'filename': tokens[1],
            'function': tokens[0] or '?',
            'in_app': True,
        }

        try:
            frame['lineno'] = int(float(tokens[2]))
        except:
            pass

        try:
            frame['colno'] = int(float(tokens[3]))
        except:
            pass

        return Frame.to_python(frame)
开发者ID:Banno,项目名称:getsentry-javascript-lite,代码行数:20,代码来源:plugin.py


示例20: format_firefox_safari_frame

    def format_firefox_safari_frame(self, frame):
        tokens = JavascriptLiteSourceProcessor.firefox_safari_stacktrace_expr.findall(frame)[0]

        frame = {
            'filename': tokens[2],
            'function': tokens[0] or '?',
            'in_app': True,
        }

        if tokens[1]:
            frame['args'] = tokens[1].split(',')

        try:
            frame['lineno'] = int(float(tokens[3]))
        except:
            pass

        try:
            frame['colno'] = int(float(tokens[4]))
        except:
            pass

        return Frame.to_python(frame)
开发者ID:Banno,项目名称:getsentry-javascript-lite,代码行数:23,代码来源:plugin.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python stacktrace.Stacktrace类代码示例发布时间:2022-05-27
下一篇:
Python http.Http类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap