#NEWLINE# def test_senlin( self ) : #NEWLINE# #INDENT# mock_senlin = mock . MagicMock ( ) #NEWLINE# self . assertNotIn ( 'senlin' , self . clients . cache ) #NEWLINE# with mock . patch . dict ( 'sys.modules' , { #NEWLINE# #INDENT# 'senlinclient' : mock_senlin , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# client = self . clients . senlin ( ) #NEWLINE# self . assertEqual ( mock_senlin . client . Client . return_value , client ) #NEWLINE# mock_senlin . client . Client . assert_called_once_with ( '1' , username = self . credential . username , password = self . credential . password , project_name = self . credential . tenant_name , auth_url = self . credential . auth_url ) #NEWLINE# self . assertEqual ( mock_senlin . client . Client . return_value , self . clients . cache [ 'senlin' ] )