[TESTS] Add noticications utilities
Change-Id: Id15f23e4679b7e61181ef429588fd481763414e8
This commit is contained in:

committed by
David Shrewsbury

parent
ae895c5c60
commit
5a2b4965e9
@@ -43,6 +43,8 @@ from libra.openstack.common import log
|
|||||||
from libra.openstack.common import test
|
from libra.openstack.common import test
|
||||||
from libra.openstack.common.fixture import config
|
from libra.openstack.common.fixture import config
|
||||||
from libra.openstack.common.fixture import moxstubout
|
from libra.openstack.common.fixture import moxstubout
|
||||||
|
from libra.openstack.common.notifier import test_notifier
|
||||||
|
|
||||||
|
|
||||||
options.CONF.set_override('use_stderr', False)
|
options.CONF.set_override('use_stderr', False)
|
||||||
|
|
||||||
@@ -55,6 +57,17 @@ log.setup('libra')
|
|||||||
_DB_CACHE = None
|
_DB_CACHE = None
|
||||||
|
|
||||||
|
|
||||||
|
class NotifierFixture(fixtures.Fixture):
|
||||||
|
def tearDown(self):
|
||||||
|
self.clear()
|
||||||
|
|
||||||
|
def get(self):
|
||||||
|
return test_notifier.NOTIFICATIONS
|
||||||
|
|
||||||
|
def clear(self):
|
||||||
|
test_notifier.NOTIFICATIONS = []
|
||||||
|
|
||||||
|
|
||||||
class Database(fixtures.Fixture):
|
class Database(fixtures.Fixture):
|
||||||
"""
|
"""
|
||||||
Fixture for Databases. Handles syncing, tearing down etc.
|
Fixture for Databases. Handles syncing, tearing down etc.
|
||||||
@@ -137,7 +150,7 @@ class ServiceTestCase(test.BaseTestCase):
|
|||||||
self.CONF.set_override('swift_endpoint', 'test', group='api')
|
self.CONF.set_override('swift_endpoint', 'test', group='api')
|
||||||
self.CONF.set_override('swift_basepath', 'test', group='api')
|
self.CONF.set_override('swift_basepath', 'test', group='api')
|
||||||
|
|
||||||
self.CONF.set_override('driver', 'gearman_fake', group='gearman')
|
self.notifications = NotifierFixture()
|
||||||
|
self.useFixture(self.notifications)
|
||||||
|
|
||||||
self.CONF([], project='libra')
|
self.CONF([], project='libra')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user