<s> import fixtures <EOL> import oslo_messaging as messaging <EOL> class CastAsCall ( fixtures . Fixture ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , stubs ) : <EOL> super ( CastAsCall , self ) . __init__ ( ) <EOL> self . stubs = stubs <EOL> @ staticmethod <EOL> def _stub_out ( stubs , obj ) : <EOL> orig_prepare = obj . prepare <EOL> def prepare ( self , * args , ** kwargs ) : <EOL> if '<STR_LIT>' in kwargs : <EOL> kwargs [ '<STR_LIT>' ] = False <EOL> cctxt = orig_prepare ( self , * args , ** kwargs ) <EOL> CastAsCall . _stub_out ( stubs , cctxt ) <EOL> return cctxt <EOL> stubs . Set ( obj , '<STR_LIT>' , prepare ) <EOL> stubs . Set ( obj , '<STR_LIT>' , obj . call ) <EOL> def setUp ( self ) : <EOL> super ( CastAsCall , self ) . setUp ( ) <EOL> self . _stub_out ( self . stubs , messaging . RPCClient ) </s>
