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)
(cherry picked from commit ee32ea5e2b)
This commit is contained in:
Ihar Hrachyshka 2016-04-07 19:15:01 +02:00
parent 1edafdd8f5
commit 275a1714e8
1 changed files with 2 additions and 6 deletions

View File

@ -65,10 +65,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.
@ -341,9 +337,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))