Switched from fixtures to mock to mock out starting RPC consumers

fixtures 2.0.0 broke us wildly, so instead of trying to make it work
with new fixtures, I better just switch the mock to... mock.

Change-Id: I58d7a750e263e4af54589ace07ac00bec34b553a
Closes-Bug: #1567295
(cherry picked from commit 2af86b8f6f)
This commit is contained in:
Ihar Hrachyshka 2016-04-07 19:15:01 +02:00
parent 33c01f4d49
commit ee32ea5e2b

View File

@ -66,10 +66,6 @@ def fake_use_fatal_exceptions(*args):
return True
def fake_consume_in_threads(self):
return []
def get_rand_name(max_length=None, prefix='test'):
"""Return a random string.
@ -318,9 +314,9 @@ class BaseTestCase(DietTestCase):
def setup_rpc_mocks(self):
# don't actually start RPC listeners when testing
self.useFixture(fixtures.MonkeyPatch(
mock.patch(
'neutron.common.rpc.Connection.consume_in_threads',
fake_consume_in_threads))
return_value=[]).start()
self.useFixture(fixtures.MonkeyPatch(
'oslo_messaging.Notifier', fake_notifier.FakeNotifier))