Example #1
0
 def test_debug_mode(self):
     app = ErrorReporter(simple_app,
                         dict(debug='on'),
                         enable=True,
                         error_email='*****@*****.**')
     assert app is simple_app
Example #2
0
 def test_enable_email(self):
     app = ErrorReporter(simple_app, {}, error_email='*****@*****.**')
     assert app.__class__.__name__ == self.middleware_name
     assert any(r.__class__.__name__ == 'EmailReporter'
                for r in app.reporters)
Example #3
0
 def test_enable_sentry(self):
     app = ErrorReporter(simple_app, {},
                         sentry_dsn='http://*****:*****@example.com/1')
     assert app.__class__.__name__ == self.middleware_name
     assert any(r.__class__.__name__ == 'SentryReporter'
                for r in app.reporters)
Example #4
0
 def test_enable_true(self):
     app = ErrorReporter(simple_app, {}, enable=True)
     assert app.__class__.__name__ == self.middleware_name
     assert not app.reporters
Example #5
0
 def test_enable_false(self):
     app = ErrorReporter(simple_app, {}, enable=False)
     assert app.__class__.__name__ != self.middleware_name
Example #6
0
 def test_enable_sentry(self):
     app = ErrorReporter(simple_app, {},
                         sentry_dsn='http://*****:*****@example.com/1')
     reporters = [r.__class__.__name__ for r in app.reporters]
     assert 'SentryReporter' in reporters
Example #7
0
 def test_enable_email(self):
     app = ErrorReporter(simple_app, {}, error_email='*****@*****.**')
     reporters = [r.__class__.__name__ for r in app.reporters]
     assert 'EmailReporter' in reporters
Example #8
0
 def test_disable_all(self):
     app = ErrorReporter(simple_app, {})
     reporters = [r.__class__.__name__ for r in app.reporters]
     assert 'EmailReporter' not in reporters
     assert 'SentryReporter' not in reporters