-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b840f60
commit 4d89252
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import unittest | ||
|
||
from serpens import sentry | ||
|
||
|
||
class TestSentry(unittest.TestCase): | ||
def test_before_send_with_exc_info(self): | ||
event = "foo" | ||
hint = {"exc_info": ["exception", "foo", "bar"]} | ||
|
||
response = sentry.before_send(event, hint) | ||
|
||
self.assertIsNotNone(response) | ||
self.assertEqual(response, event) | ||
|
||
def test_before_send_without_exc_info(self): | ||
event = "foo" | ||
hint = "bar" | ||
|
||
response = sentry.before_send(event, hint) | ||
|
||
self.assertIsNotNone(response) | ||
self.assertEqual(response, event) | ||
|
||
def test_before_send_filtering_event(self): | ||
event = sentry.FilteredEvent("foo") | ||
hint = {"exc_info": ["exception", event, "bar"]} | ||
|
||
response = sentry.before_send(event, hint) | ||
|
||
self.assertIsNone(response) |