#NEWLINE# def test_murano( self ) : #NEWLINE# #INDENT# fake_murano = fakes . FakeMuranoClient ( ) #NEWLINE# mock_murano = mock . Mock ( ) #NEWLINE# mock_murano . client . Client . return_value = fake_murano #NEWLINE# self . assertNotIn ( 'murano' , self . clients . cache ) #NEWLINE# with mock . patch . dict ( 'sys.modules' , { #NEWLINE# #INDENT# 'muranoclient' : mock_murano , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# client = self . clients . murano ( ) #NEWLINE# self . assertEqual ( fake_murano , fake_murano ) #NEWLINE# self . service_catalog . url_for . assert_called_once_with ( service_type = 'application-catalog' , endpoint_type = consts . EndpointType . PUBLIC , region_name = self . credential . region_name ) #NEWLINE# kw = { #NEWLINE# #INDENT# 'endpoint' : self . service_catalog . url_for . return_value , #NEWLINE# 'token' : self . fake_keystone . auth_token , #NEWLINE# #UNINDENT# } #NEWLINE# mock_murano . client . Client . assert_called_once_with ( '1' , ** kw ) #NEWLINE# self . assertEqual ( fake_murano , self . clients . cache [ 'murano' ] )