summaryrefslogtreecommitdiff
path: root/tests/processors
diff options
context:
space:
mode:
authorDavid Cramer <dcramer@gmail.com>2012-04-18 21:33:11 -0700
committerDavid Cramer <dcramer@gmail.com>2012-04-18 21:33:11 -0700
commit634f5f3c7d8e3319be6f8ce05f66df4ec7f00388 (patch)
tree7ad4f7b28997259d95344eba4f3d5a2ee6e84950 /tests/processors
parent6280925f1d521b4d9109dea45dc18518a01bed46 (diff)
downloadraven-634f5f3c7d8e3319be6f8ce05f66df4ec7f00388.tar.gz
Added RemovePostDataProcessor and RemoveStackLocalsProcessor
Diffstat (limited to 'tests/processors')
-rw-r--r--tests/processors/tests.py44
1 files changed, 43 insertions, 1 deletions
diff --git a/tests/processors/tests.py b/tests/processors/tests.py
index 449d1b9..901223d 100644
--- a/tests/processors/tests.py
+++ b/tests/processors/tests.py
@@ -2,7 +2,8 @@
from mock import Mock
from unittest2 import TestCase
-from raven.processors import SanitizePasswordsProcessor
+from raven.processors import SanitizePasswordsProcessor, RemovePostDataProcessor, \
+ RemoveStackLocalsProcessor
class SantizePasswordsProcessorTest(TestCase):
@@ -101,3 +102,44 @@ class SantizePasswordsProcessorTest(TestCase):
self.assertTrue('sentry.interfaces.Http' in result)
http = result['sentry.interfaces.Http']
self.assertEquals(http['querystring'], 'foo=bar&password=%(m)s&the_secret=%(m)s&a_password_here=%(m)s' % dict(m=proc.MASK))
+
+
+class RemovePostDataProcessorTest(TestCase):
+ def test_does_remove_body(self):
+ data = {
+ 'sentry.interfaces.Http': {
+ 'body': 'foo',
+ }
+ }
+
+ proc = RemovePostDataProcessor(Mock())
+ result = proc.process(data)
+
+ self.assertTrue('sentry.interfaces.Http' in result)
+ http = result['sentry.interfaces.Http']
+ self.assertFalse('body' in http)
+
+
+class RemoveStackLocalsProcessorTest(TestCase):
+ def test_does_remove_body(self):
+ data = {
+ 'sentry.interfaces.Stacktrace': {
+ 'frames': [
+ {
+ 'vars': {
+ 'foo': 'bar',
+ 'password': 'hello',
+ 'the_secret': 'hello',
+ 'a_password_here': 'hello',
+ },
+ }
+ ]
+ }
+ }
+ proc = RemoveStackLocalsProcessor(Mock())
+ result = proc.process(data)
+
+ self.assertTrue('sentry.interfaces.Stacktrace' in result)
+ stack = result['sentry.interfaces.Stacktrace']
+ for frame in stack['frames']:
+ self.assertFalse('vars' in frame)