#NEWLINE# @ mock . patch ( 'solum.common.solum_swiftclient.SwiftClient.delete_object' ) #NEWLINE# def test_userlog_delete_swift_logs( self , mock_swift_delete , mock_registry ) : #NEWLINE# #INDENT# fi = fakes . FakeImage ( ) #NEWLINE# fakelog = fakes . FakeUserlog ( ) #NEWLINE# fakelog . strategy = 'swift' #NEWLINE# fakelog . strategy_info = '{"container": "solum-logs"}' #NEWLINE# flogs = [ fakelog ] #NEWLINE# s_info = json . loads ( flogs [ 0 ] . strategy_info ) [ 'container' ] #NEWLINE# location = flogs [ 0 ] . location #NEWLINE# mock_registry . UserlogList . get_all_by_id . return_value = flogs #NEWLINE# handler = userlog_handler . UserlogHandler ( self . ctx ) #NEWLINE# handler . delete ( fi . uuid ) #NEWLINE# mock_registry . UserlogList . get_all_by_id . assert_called_once_with ( self . ctx , resource_uuid = fi . uuid ) #NEWLINE# mock_swift_delete . assert_called_once_with ( s_info , location ) #NEWLINE# fakelog . destroy . assert_called_once_with ( self . ctx )