Exemplo n.º 1
0
    def test_simple(self):
        event = Group.objects.from_kwargs(1, message='foo', **{
            'sentry.interfaces.Exception': {
                'values': [{
                    'type': 'TypeError',
                    'value': 'test',
                    'stacktrace': {
                        'frames': [{
                            'function': 'bar',
                            'filename': 'foo.py',
                            'in_app': True,
                        }],
                    },
                }],
            },
        })

        with patch.object(Group.objects, 'add_tags') as add_tags:
            record_affected_code(event=event)

            add_tags.assert_called_once_with(event.group, [
                ('sentry:filename', '1effb24729ae4c43efa36b460511136a', {
                    'filename': 'foo.py',
                }),
                ('sentry:function', '7823c20ad591da0bbb78d083c118609c', {
                    'filename': 'foo.py',
                    'function': 'bar',
                })
            ])
Exemplo n.º 2
0
    def test_simple(self):
        event = Group.objects.from_kwargs(1,
                                          message='foo',
                                          **{
                                              'sentry.interfaces.Exception': {
                                                  'values': [{
                                                      'type': 'TypeError',
                                                      'value': 'test',
                                                      'stacktrace': {
                                                          'frames': [{
                                                              'function':
                                                              'bar',
                                                              'filename':
                                                              'foo.py',
                                                              'in_app':
                                                              True,
                                                          }],
                                                      },
                                                  }],
                                              },
                                          })

        with patch.object(Group.objects, 'add_tags') as add_tags:
            record_affected_code(group=event.group, event=event)

            add_tags.assert_called_once_with(
                event.group,
                [('sentry:filename', '1effb24729ae4c43efa36b460511136a', {
                    'filename': 'foo.py',
                }),
                 ('sentry:function', '7823c20ad591da0bbb78d083c118609c', {
                     'filename': 'foo.py',
                     'function': 'bar',
                 })])
Exemplo n.º 3
0
    def test_simple(self):
        event = Group.objects.from_kwargs(
            1,
            message="foo",
            **{
                "sentry.interfaces.Exception": {
                    "values": [
                        {
                            "type": "TypeError",
                            "value": "test",
                            "stacktrace": {"frames": [{"function": "bar", "filename": "foo.py", "in_app": True}]},
                        }
                    ]
                }
            }
        )

        with patch.object(Group.objects, "add_tags") as add_tags:
            record_affected_code(group=event.group, event=event)

            add_tags.assert_called_once_with(
                event.group,
                [
                    ("sentry:filename", "1effb24729ae4c43efa36b460511136a", {"filename": "foo.py"}),
                    ("sentry:function", "7823c20ad591da0bbb78d083c118609c", {"filename": "foo.py", "function": "bar"}),
                ],
            )