Exemple #1
0
    def test_null_values(self):
        sink = {"values": []}
        assert Threads.to_python({}).to_json() == sink
        assert Threads.to_python({'values': []}).to_json() == sink
        assert Threads.to_python({'values': None}).to_json() == sink

        # TODO(markus): Should eventually generate values: [None]
        assert Threads.to_python({"values": [None]}).to_json() == sink
Exemple #2
0
    def test_null_values_in_values(self):
        sink = {"values": [{
            "crashed": False,
            "current": False,
        }]}

        assert Threads.to_python({"values": [{}]}).to_json() == sink
        assert Threads.to_python({"values": [{"id": None}]}).to_json() == sink
        assert Threads.to_python({"values": [{"name": None}]}).to_json() == sink
        assert Threads.to_python({"values": [{"stacktrace": None}]}).to_json() == sink
Exemple #3
0
 def interface(self):
     return Threads.to_python(
         dict(
             values=[
                 {
                     'id': 42,
                     'crashed': False,
                     'current': True,
                     'name': 'Main Thread',
                     'stacktrace': {
                         'frames': [
                             {
                                 'filename': 'foo/baz.c',
                                 'function': 'main',
                                 'lineno': 1,
                                 'in_app': True,
                             }
                         ]
                     },
                     'raw_stacktrace': {
                         'frames': [
                             {
                                 'filename': None,
                                 'lineno': 1,
                                 'function': '<redacted>',
                                 'in_app': True,
                             }
                         ]
                     },
                 }
             ]
         )
     )
Exemple #4
0
 def test_no_hash(self):
     interface = Threads.to_python(
         dict(
             values=[
                 {
                     'id': 42,
                     'crashed': False,
                     'current': True,
                     'name': 'Main Thread',
                     'stacktrace': {
                         'frames': [
                             {
                                 'filename': 'foo/baz.c',
                                 'function': 'main',
                                 'lineno': 1,
                                 'in_app': True,
                             }
                         ]
                     },
                     'raw_stacktrace': {
                         'frames': [
                             {
                                 'filename': None,
                                 'lineno': 1,
                                 'function': '<redacted>',
                                 'in_app': True,
                             }
                         ]
                     },
                 }, {
                     'id': 43,
                     'crashed': False,
                     'current': True,
                     'name': 'Main Thread',
                     'stacktrace': {
                         'frames': [
                             {
                                 'filename': 'foo/baz.c',
                                 'function': 'main',
                                 'lineno': 1,
                                 'in_app': True,
                             }
                         ]
                     },
                     'raw_stacktrace': {
                         'frames': [
                             {
                                 'filename': None,
                                 'lineno': 1,
                                 'function': '<redacted>',
                                 'in_app': True,
                             }
                         ]
                     },
                 }
             ]
         )
     )
     result = interface.get_hash()
     assert not result
Exemple #5
0
 def test_no_hash(self):
     interface = Threads.to_python(
         dict(
             values=[
                 {
                     'id': 42,
                     'crashed': False,
                     'current': True,
                     'name': 'Main Thread',
                     'stacktrace': {
                         'frames': [
                             {
                                 'filename': 'foo/baz.c',
                                 'function': 'main',
                                 'lineno': 1,
                                 'in_app': True,
                             }
                         ]
                     },
                     'raw_stacktrace': {
                         'frames': [
                             {
                                 'filename': None,
                                 'lineno': 1,
                                 'function': '<redacted>',
                                 'in_app': True,
                             }
                         ]
                     },
                 }, {
                     'id': 43,
                     'crashed': False,
                     'current': True,
                     'name': 'Main Thread',
                     'stacktrace': {
                         'frames': [
                             {
                                 'filename': 'foo/baz.c',
                                 'function': 'main',
                                 'lineno': 1,
                                 'in_app': True,
                             }
                         ]
                     },
                     'raw_stacktrace': {
                         'frames': [
                             {
                                 'filename': None,
                                 'lineno': 1,
                                 'function': '<redacted>',
                                 'in_app': True,
                             }
                         ]
                     },
                 }
             ]
         )
     )
     result = interface.get_hash()
     assert not result
Exemple #6
0
 def interface(self):
     return Threads.to_python(
         dict(
             values=[
                 {
                     'id': 42,
                     'crashed': False,
                     'current': True,
                     'name': 'Main Thread',
                     'stacktrace': {
                         'frames': [
                             {
                                 'filename': 'foo/baz.c',
                                 'function': 'main',
                                 'lineno': 1,
                                 'in_app': True,
                             }
                         ]
                     },
                     'raw_stacktrace': {
                         'frames': [
                             {
                                 'filename': None,
                                 'lineno': 1,
                                 'function': '<redacted>',
                                 'in_app': True,
                             }
                         ]
                     },
                 }
             ]
         )
     )