mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 03:55:43 +00:00
Fix test_alertmanager
This commit is contained in:
parent
8fb56f0410
commit
c978c6d016
@ -4,14 +4,23 @@ import common
|
|||||||
|
|
||||||
from deluge.core.alertmanager import AlertManager
|
from deluge.core.alertmanager import AlertManager
|
||||||
from deluge.core.core import Core
|
from deluge.core.core import Core
|
||||||
|
import deluge.component as component
|
||||||
|
|
||||||
class AlertManagerTestCase(unittest.TestCase):
|
class AlertManagerTestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.core = Core()
|
self.core = Core()
|
||||||
|
|
||||||
self.am = AlertManager()
|
self.am = component.get("AlertManager")
|
||||||
self.am.start()
|
component.start(["AlertManager"])
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
def on_shutdown(result):
|
||||||
|
component._ComponentRegistry.components = {}
|
||||||
|
del self.am
|
||||||
|
del self.core
|
||||||
|
|
||||||
|
return component.shutdown().addCallback(on_shutdown)
|
||||||
|
|
||||||
def test_register_handler(self):
|
def test_register_handler(self):
|
||||||
def handler(alert):
|
def handler(alert):
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user