'Create a mock credential list response.'

def _mock_credential_list(self, user_id):

    mock_credential_list = []
    for x in (1, 2, 3):
        mock_credential = self.m.CreateMockAnything()
        mock_credential.id = ('credential_id%s' % x)
        mock_credential.user_id = user_id
        mock_credential.blob = json.dumps({'access': ('access%s' % x), 'secret': ('secret%s' % x)})
        mock_credential.type = 'ec2'
        mock_credential_list.append(mock_credential)
    self.mock_ks_v3_client.credentials = self.m.CreateMockAnything()
    self.mock_ks_v3_client.credentials.list().AndReturn(mock_credential_list)
