Replace fanout to False for CastAsCall fixture

In I5f9e74f46e347594103484460e81da46835eeb7e, a new Fixture has been added for
changing oslo.messaging casts to calls. That said, it leads to a point where
fanout casts are then mapped to fanout calls, which are not yet implemented
(and somewhat conceptually hard to consider).

Here, we're asserting that if a fanout cast is made using that fixture, it will
be properly turned into a non-fanout call, which works because there is only
one ServiceManager listening to the topic in the tests.

Co-Authored-By:	EdLeafe <ed@leafe.com>

Change-Id: I1febc24ec0c09c3c17511e7ab1f2d7b6a05b6937
This commit is contained in:
Sylvain Bauza 2015-03-02 15:39:55 +01:00
parent 18a631ca17
commit 567152ba84
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ class CastAsCall(fixtures.Fixture):
orig_prepare = obj.prepare
def prepare(self, *args, **kwargs):
# Casts with fanout=True would throw errors if its monkeypatched to
# the call method, so we must override fanout to False
if 'fanout' in kwargs:
kwargs['fanout'] = False
cctxt = orig_prepare(self, *args, **kwargs)
CastAsCall._stub_out(stubs, cctxt) # woo, recurse!
return cctxt