Exemple #1
0
    def test_sanitize_real_exception(self):
        client = Client(
            'http://*****:*****@example.org/123',
            processors=('raven.processors.SanitizePasswordsProcessor',)
        )

        try:
            password = '******'
            1 / 0
        except Exception as ex:
            password = '******'
            result = client.build_msg('Exception')
        pre_context = result['sentry.interfaces.Stacktrace']['frames'][0]['pre_context']
        for value in pre_context:
            self.assertFalse(password in value)
Exemple #2
0
    def test_sanitize_real_exception(self):
        client = Client(
            'http://*****:*****@example.org/123',
            processors=('raven.processors.SanitizePasswordsProcessor', ))

        try:
            password = '******'
            1 / 0
        except Exception as ex:
            password = '******'
            result = client.build_msg('Exception')
        pre_context = result['sentry.interfaces.Stacktrace']['frames'][0][
            'pre_context']
        for value in pre_context:
            self.assertFalse(password in value)
def report_exception(): 
    # We don't report if this is run from a test, run directly from the source
    if 'nosetests' in sys.argv[0]:
        return
    if sys.argv[0].endswith('.py'):
        return
    # We use raven to get the stack trace information, but we don't use raven to report
    # because client side, reporting doesn't work python.  We need to include a secret
    # key to report, and we don't want to check in the secret key to github
    Client.register_scheme('custom+https', CustomTransport)
    client = Client('custom+https://[email protected]/666')
    data = client.build_msg('raven.events.Exception')
    requests.post(
        "https://forms.hubspot.com/uploads/form/v2/327485/2310f9fb-c192-40f2-b191-bf0b1cbcff76",
        headers={
            'content_type': "application/x-www-form-urlencoded"
            },
        data={"email": str(uuid4()) + "*****@*****.**", "json_blob": pformat(data)},
        verify=False
        )
def report_exception():
    # We don't report if this is run from a test, run directly from the source
    if 'nosetests' in sys.argv[0]:
        return
    if sys.argv[0].endswith('.py'):
        return
    # We use raven to get the stack trace information, but we don't use raven to report
    # because client side, reporting doesn't work python.  We need to include a secret
    # key to report, and we don't want to check in the secret key to github
    Client.register_scheme('custom+https', CustomTransport)
    client = Client('custom+https://[email protected]/666')
    data = client.build_msg('raven.events.Exception')
    requests.post(
        "https://forms.hubspot.com/uploads/form/v2/327485/2310f9fb-c192-40f2-b191-bf0b1cbcff76",
        headers={'content_type': "application/x-www-form-urlencoded"},
        data={
            "email": str(uuid4()) + "*****@*****.**",
            "json_blob": pformat(data)
        },
        verify=False)