mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
25 lines
736 B
Python
25 lines
736 B
Python
import pytest
|
|
|
|
from sentry.notifications.class_manager import (
|
|
NotificationClassAlreadySetException,
|
|
get,
|
|
manager,
|
|
register,
|
|
)
|
|
from sentry.testutils.cases import TestCase
|
|
from sentry.testutils.helpers.notifications import AnotherDummyNotification
|
|
|
|
|
|
class ClassManagerTest(TestCase):
|
|
def tearDown(self):
|
|
manager.classes.pop("AnotherDummyNotification", None)
|
|
|
|
def test_register(self):
|
|
register()(AnotherDummyNotification)
|
|
assert get("AnotherDummyNotification") == AnotherDummyNotification
|
|
|
|
def test_duplicate_register(self):
|
|
register()(AnotherDummyNotification)
|
|
with pytest.raises(NotificationClassAlreadySetException):
|
|
register()(AnotherDummyNotification)
|