#NEWLINE# @ mock . patch . object ( clients . OpenStackClients , 'url_for' ) #NEWLINE# @ mock . patch . object ( clients . OpenStackClients , 'auth_url' ) #NEWLINE# def test_clients_swift_not_cached( self , mock_auth , mock_url ) : #NEWLINE# #INDENT# mock_auth . __get__ = mock . Mock ( return_value = 'keystone_url' ) #NEWLINE# con = mock . MagicMock ( ) #NEWLINE# con . tenant = 'b363706f891f48019483f8bd6503c54b' #NEWLINE# con . auth_token = '3bcc3d3a03f44e3d8377f9247b0ad155' #NEWLINE# mock_url . return_value = 'url_from_keystone' #NEWLINE# obj = clients . OpenStackClients ( con ) #NEWLINE# obj . _swift = None #NEWLINE# swift = obj . swift ( ) #NEWLINE# swift_cached = obj . swift ( ) #NEWLINE# self . assertNotEqual ( swift , swift_cached )