From c978c6d016b396a404bb52cac70724bd8f1d9a37 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 25 Mar 2010 11:47:05 -0700 Subject: [PATCH] Fix test_alertmanager --- tests/test_alertmanager.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_alertmanager.py b/tests/test_alertmanager.py index 8f16df21f..ae3fb1733 100644 --- a/tests/test_alertmanager.py +++ b/tests/test_alertmanager.py @@ -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