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


Python Frame.to_python方法代码示例

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


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

示例1: test_context_with_nan

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:30,代码来源:test_stacktrace.py

示例2: test_get_hash_sanitizes_versioned_filenames

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
    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,代码行数:31,代码来源:test_stacktrace.py

示例3: test_get_hash_ignores_filename_if_https

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:9,代码来源:test_stacktrace.py

示例4: test_get_hash_with_only_required_vars

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:9,代码来源:test_stacktrace.py

示例5: test_get_hash_sanitizes_erb_templates

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:9,代码来源:test_stacktrace.py

示例6: test_get_hash_sanitizes_versioned_filenames

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
    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,代码行数:18,代码来源:test_stacktrace.py

示例7: test_get_hash_uses_function_over_lineno

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:10,代码来源:test_stacktrace.py

示例8: test_get_hash_uses_module_over_filename

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:10,代码来源:test_stacktrace.py

示例9: test_get_hash_ignores_filename_if_blob

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:10,代码来源:test_stacktrace.py

示例10: test_get_hash_ignores_safari_native_code

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:10,代码来源:test_stacktrace.py

示例11: test_get_hash_sanitizes_block_functions

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:10,代码来源:test_stacktrace.py

示例12: test_get_hash_ignores_java8_lambda_module

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:12,代码来源:test_stacktrace.py

示例13: test_get_hash_ignores_java8_lambda_function

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:12,代码来源:test_stacktrace.py

示例14: test_get_hash_ignores_extra_ENHANCED_clojure_classes

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:12,代码来源:test_stacktrace.py

示例15: test_get_hash_sanitizes_erb_templates

# 需要导入模块: from sentry.interfaces.stacktrace import Frame [as 别名]
# 或者: from sentry.interfaces.stacktrace.Frame import to_python [as 别名]
 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,代码行数:12,代码来源:test_stacktrace.py


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