Fix test_alertmanager

This commit is contained in:
Andrew Resch 2010-03-25 11:47:05 -07:00
parent 8fb56f0410
commit c978c6d016
1 changed files with 11 additions and 2 deletions

View File

@ -4,14 +4,23 @@ import common
from deluge.core.alertmanager import AlertManager
from deluge.core.core import Core
import deluge.component as component
class AlertManagerTestCase(unittest.TestCase):
def setUp(self):
self.core = Core()
self.am = AlertManager()
self.am.start()
self.am = component.get("AlertManager")
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 handler(alert):
return