identity: Migrate 'service provider' commands to SDK

Change-Id: I7f5fba408b7c350bb0a279f8dd17bd7bae451774
This commit is contained in:
Antonia Gaete 2024-09-19 17:53:51 +00:00
parent 58d1b06fdc
commit 56baf50655
4 changed files with 264 additions and 258 deletions

View File

@ -25,6 +25,29 @@ from openstackclient.i18n import _
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
def _format_service_provider(sp):
column_headers = (
'id',
'enabled',
'description',
'auth_url',
'sp_url',
'relay_state_prefix',
)
columns = (
'id',
'is_enabled',
'description',
'auth_url',
'sp_url',
'relay_state_prefix',
)
return (
column_headers,
utils.get_item_properties(sp, columns),
)
class CreateServiceProvider(command.ShowOne): class CreateServiceProvider(command.ShowOne):
_description = _("Create new service provider") _description = _("Create new service provider")
@ -62,14 +85,14 @@ class CreateServiceProvider(command.ShowOne):
enable_service_provider = parser.add_mutually_exclusive_group() enable_service_provider = parser.add_mutually_exclusive_group()
enable_service_provider.add_argument( enable_service_provider.add_argument(
'--enable', '--enable',
dest='enabled', dest='is_enabled',
action='store_true', action='store_true',
default=True, default=True,
help=_('Enable the service provider (default)'), help=_('Enable the service provider (default)'),
) )
enable_service_provider.add_argument( enable_service_provider.add_argument(
'--disable', '--disable',
dest='enabled', dest='is_enabled',
action='store_false', action='store_false',
help=_('Disable the service provider'), help=_('Disable the service provider'),
) )
@ -77,17 +100,27 @@ class CreateServiceProvider(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
service_client = self.app.client_manager.identity service_client = self.app.client_manager.sdk_connection.identity
sp = service_client.federation.service_providers.create(
id=parsed_args.service_provider_id,
auth_url=parsed_args.auth_url,
description=parsed_args.description,
enabled=parsed_args.enabled,
sp_url=parsed_args.service_provider_url,
)
sp._info.pop('links', None) kwargs = {}
return zip(*sorted(sp._info.items()))
kwargs = {'id': parsed_args.service_provider_id}
if parsed_args.is_enabled is not None:
kwargs['is_enabled'] = parsed_args.is_enabled
if parsed_args.description:
kwargs['description'] = parsed_args.description
if parsed_args.auth_url:
kwargs['auth_url'] = parsed_args.auth_url
if parsed_args.service_provider_url:
kwargs['sp_url'] = parsed_args.service_provider_url
sp = service_client.create_service_provider(**kwargs)
return _format_service_provider(sp)
class DeleteServiceProvider(command.Command): class DeleteServiceProvider(command.Command):
@ -104,11 +137,11 @@ class DeleteServiceProvider(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
service_client = self.app.client_manager.identity service_client = self.app.client_manager.sdk_connection.identity
result = 0 result = 0
for i in parsed_args.service_provider: for i in parsed_args.service_provider:
try: try:
service_client.federation.service_providers.delete(i) service_client.delete_service_provider(i)
except Exception as e: except Exception as e:
result += 1 result += 1
LOG.error( LOG.error(
@ -132,24 +165,32 @@ class ListServiceProvider(command.Lister):
_description = _("List service providers") _description = _("List service providers")
def take_action(self, parsed_args): def take_action(self, parsed_args):
service_client = self.app.client_manager.identity service_client = self.app.client_manager.sdk_connection.identity
data = service_client.federation.service_providers.list() data = service_client.service_providers()
column_headers = ('ID', 'Enabled', 'Description', 'Auth URL') column_headers = (
'ID',
'Enabled',
'Description',
'Auth URL',
'Service Provider URL',
'Relay State Prefix',
)
columns = (
'id',
'is_enabled',
'description',
'auth_url',
'sp_url',
'relay_state_prefix',
)
return ( return (
column_headers, column_headers,
( (utils.get_item_properties(s, columns) for s in data),
utils.get_item_properties(
s,
column_headers,
formatters={},
)
for s in data
),
) )
class SetServiceProvider(command.Command): class SetServiceProvider(command.ShowOne):
_description = _("Set service provider properties") _description = _("Set service provider properties")
def get_parser(self, prog_name): def get_parser(self, prog_name):
@ -181,33 +222,44 @@ class SetServiceProvider(command.Command):
enable_service_provider = parser.add_mutually_exclusive_group() enable_service_provider = parser.add_mutually_exclusive_group()
enable_service_provider.add_argument( enable_service_provider.add_argument(
'--enable', '--enable',
dest='is_enabled',
action='store_true', action='store_true',
default=None,
help=_('Enable the service provider'), help=_('Enable the service provider'),
) )
enable_service_provider.add_argument( enable_service_provider.add_argument(
'--disable', '--disable',
action='store_true', dest='is_enabled',
action='store_false',
default=None,
help=_('Disable the service provider'), help=_('Disable the service provider'),
) )
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
federation_client = self.app.client_manager.identity.federation service_client = self.app.client_manager.sdk_connection.identity
enabled = None kwargs = {}
if parsed_args.enable is True:
enabled = True
elif parsed_args.disable is True:
enabled = False
federation_client.service_providers.update( if parsed_args.is_enabled is not None:
kwargs['is_enabled'] = parsed_args.is_enabled
if parsed_args.description:
kwargs['description'] = parsed_args.description
if parsed_args.auth_url:
kwargs['auth_url'] = parsed_args.auth_url
if parsed_args.service_provider_url:
kwargs['sp_url'] = parsed_args.service_provider_url
service_provider = service_client.update_service_provider(
parsed_args.service_provider, parsed_args.service_provider,
enabled=enabled, **kwargs,
description=parsed_args.description,
auth_url=parsed_args.auth_url,
sp_url=parsed_args.service_provider_url,
) )
return _format_service_provider(service_provider)
class ShowServiceProvider(command.ShowOne): class ShowServiceProvider(command.ShowOne):
_description = _("Display service provider details") _description = _("Display service provider details")
@ -222,12 +274,10 @@ class ShowServiceProvider(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
service_client = self.app.client_manager.identity service_client = self.app.client_manager.sdk_connection.identity
service_provider = utils.find_resource( service_provider = service_client.find_service_provider(
service_client.federation.service_providers,
parsed_args.service_provider, parsed_args.service_provider,
id=parsed_args.service_provider, ignore_missing=False,
) )
service_provider._info.pop('links', None) return _format_service_provider(service_provider)
return zip(*sorted(service_provider._info.items()))

View File

@ -60,9 +60,5 @@ class ServiceProviderTests(common.IdentityTests):
'description': new_description, 'description': new_description,
} }
) )
self.assertEqual(0, len(raw_output))
raw_output = self.openstack(
f'service provider show {service_provider}'
)
updated_value = self.parse_show_as_object(raw_output) updated_value = self.parse_show_as_object(raw_output)
self.assertIn(new_description, updated_value['description']) self.assertEqual(new_description, updated_value.get('description'))

View File

@ -12,92 +12,88 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import copy
from openstack.identity.v3 import service_provider as _service_provider
from openstack.test import fakes as sdk_fakes
from openstackclient.identity.v3 import service_provider from openstackclient.identity.v3 import service_provider
from openstackclient.tests.unit import fakes
from openstackclient.tests.unit.identity.v3 import fakes as service_fakes from openstackclient.tests.unit.identity.v3 import fakes as service_fakes
class TestServiceProvider(service_fakes.TestFederatedIdentity): class TestServiceProviderCreate(service_fakes.TestFederatedIdentity):
def setUp(self):
super().setUp()
federation_lib = self.identity_client.federation
self.service_providers_mock = federation_lib.service_providers
self.service_providers_mock.reset_mock()
class TestServiceProviderCreate(TestServiceProvider):
columns = ( columns = (
'auth_url',
'description',
'enabled',
'id', 'id',
'enabled',
'description',
'auth_url',
'sp_url', 'sp_url',
) 'relay_state_prefix',
datalist = (
service_fakes.sp_auth_url,
service_fakes.sp_description,
True,
service_fakes.sp_id,
service_fakes.service_provider_url,
) )
def setUp(self): def setUp(self):
super().setUp() super().setUp()
copied_sp = copy.deepcopy(service_fakes.SERVICE_PROVIDER) self.service_provider = sdk_fakes.generate_fake_resource(
resource = fakes.FakeResource(None, copied_sp, loaded=True) _service_provider.ServiceProvider
self.service_providers_mock.create.return_value = resource )
self.identity_sdk_client.create_service_provider.return_value = (
self.service_provider
)
self.data = (
self.service_provider.id,
self.service_provider.is_enabled,
self.service_provider.description,
self.service_provider.auth_url,
self.service_provider.sp_url,
self.service_provider.relay_state_prefix,
)
self.cmd = service_provider.CreateServiceProvider(self.app, None) self.cmd = service_provider.CreateServiceProvider(self.app, None)
def test_create_service_provider_required_options_only(self): def test_create_service_provider_required_options_only(self):
arglist = [ arglist = [
'--auth-url', '--auth-url',
service_fakes.sp_auth_url, self.service_provider.auth_url,
'--service-provider-url', '--service-provider-url',
service_fakes.service_provider_url, self.service_provider.sp_url,
service_fakes.sp_id, self.service_provider.id,
] ]
verifylist = [ verifylist = [
('auth_url', service_fakes.sp_auth_url), ('auth_url', self.service_provider.auth_url),
('service_provider_url', service_fakes.service_provider_url), ('service_provider_url', self.service_provider.sp_url),
('service_provider_id', service_fakes.sp_id), ('service_provider_id', self.service_provider.id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
# Set expected values # Set expected values
kwargs = { kwargs = {
'enabled': True, 'is_enabled': True,
'description': None, 'auth_url': self.service_provider.auth_url,
'auth_url': service_fakes.sp_auth_url, 'sp_url': self.service_provider.sp_url,
'sp_url': service_fakes.service_provider_url,
} }
self.service_providers_mock.create.assert_called_with( self.identity_sdk_client.create_service_provider.assert_called_with(
id=service_fakes.sp_id, **kwargs id=self.service_provider.id, **kwargs
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertEqual(self.datalist, data) self.assertEqual(self.data, data)
def test_create_service_provider_description(self): def test_create_service_provider_description(self):
arglist = [ arglist = [
'--description', '--description',
service_fakes.sp_description, self.service_provider.description,
'--auth-url', '--auth-url',
service_fakes.sp_auth_url, self.service_provider.auth_url,
'--service-provider-url', '--service-provider-url',
service_fakes.service_provider_url, self.service_provider.sp_url,
service_fakes.sp_id, self.service_provider.id,
] ]
verifylist = [ verifylist = [
('description', service_fakes.sp_description), ('description', self.service_provider.description),
('auth_url', service_fakes.sp_auth_url), ('auth_url', self.service_provider.auth_url),
('service_provider_url', service_fakes.service_provider_url), ('service_provider_url', self.service_provider.sp_url),
('service_provider_id', service_fakes.sp_id), ('service_provider_id', self.service_provider.id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@ -105,111 +101,85 @@ class TestServiceProviderCreate(TestServiceProvider):
# Set expected values # Set expected values
kwargs = { kwargs = {
'description': service_fakes.sp_description, 'description': self.service_provider.description,
'auth_url': service_fakes.sp_auth_url, 'auth_url': self.service_provider.auth_url,
'sp_url': service_fakes.service_provider_url, 'sp_url': self.service_provider.sp_url,
'enabled': True, 'is_enabled': self.service_provider.is_enabled,
} }
self.service_providers_mock.create.assert_called_with( self.identity_sdk_client.create_service_provider.assert_called_with(
id=service_fakes.sp_id, **kwargs id=self.service_provider.id, **kwargs
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertEqual(self.datalist, data) self.assertEqual(self.data, data)
def test_create_service_provider_disabled(self): def test_create_service_provider_disabled(self):
# Prepare FakeResource object
service_provider = copy.deepcopy(service_fakes.SERVICE_PROVIDER)
service_provider['enabled'] = False
service_provider['description'] = None
resource = fakes.FakeResource(None, service_provider, loaded=True)
self.service_providers_mock.create.return_value = resource
arglist = [ arglist = [
'--auth-url', '--auth-url',
service_fakes.sp_auth_url, self.service_provider.auth_url,
'--service-provider-url', '--service-provider-url',
service_fakes.service_provider_url, self.service_provider.sp_url,
'--disable', '--disable',
service_fakes.sp_id, self.service_provider.id,
] ]
verifylist = [ verifylist = [
('auth_url', service_fakes.sp_auth_url), ('auth_url', self.service_provider.auth_url),
('service_provider_url', service_fakes.service_provider_url), ('service_provider_url', self.service_provider.sp_url),
('service_provider_id', service_fakes.sp_id), ('service_provider_id', self.service_provider.id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
# Set expected values # Set expected values
kwargs = { kwargs = {
'auth_url': service_fakes.sp_auth_url, 'auth_url': self.service_provider.auth_url,
'sp_url': service_fakes.service_provider_url, 'sp_url': self.service_provider.sp_url,
'enabled': False, 'is_enabled': False,
'description': None,
} }
self.service_providers_mock.create.assert_called_with( self.identity_sdk_client.create_service_provider.assert_called_with(
id=service_fakes.sp_id, **kwargs id=self.service_provider.id, **kwargs
) )
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
datalist = ( self.assertEqual(self.data, data)
service_fakes.sp_auth_url,
None,
False,
service_fakes.sp_id,
service_fakes.service_provider_url,
)
self.assertEqual(datalist, data)
class TestServiceProviderDelete(TestServiceProvider): class TestServiceProviderDelete(service_fakes.TestFederatedIdentity):
def setUp(self): def setUp(self):
super().setUp() super().setUp()
# This is the return value for utils.find_resource() self.service_provider = sdk_fakes.generate_fake_resource(
self.service_providers_mock.get.return_value = fakes.FakeResource( _service_provider.ServiceProvider
None,
copy.deepcopy(service_fakes.SERVICE_PROVIDER),
loaded=True,
) )
self.identity_sdk_client.delete_service_provider.return_value = None
self.service_providers_mock.delete.return_value = None
self.cmd = service_provider.DeleteServiceProvider(self.app, None) self.cmd = service_provider.DeleteServiceProvider(self.app, None)
def test_delete_service_provider(self): def test_delete_service_provider(self):
arglist = [ arglist = [
service_fakes.sp_id, self.service_provider.id,
] ]
verifylist = [ verifylist = [
('service_provider', [service_fakes.sp_id]), ('service_provider', [self.service_provider.id]),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
result = self.cmd.take_action(parsed_args) result = self.cmd.take_action(parsed_args)
self.service_providers_mock.delete.assert_called_with( self.identity_sdk_client.delete_service_provider.assert_called_with(
service_fakes.sp_id, self.service_provider.id,
) )
self.assertIsNone(result) self.assertIsNone(result)
class TestServiceProviderList(TestServiceProvider): class TestServiceProviderList(service_fakes.TestFederatedIdentity):
def setUp(self): def setUp(self):
super().setUp() super().setUp()
self.service_providers_mock.get.return_value = fakes.FakeResource( self.service_provider = sdk_fakes.generate_fake_resource(
None, _service_provider.ServiceProvider
copy.deepcopy(service_fakes.SERVICE_PROVIDER),
loaded=True,
) )
self.service_providers_mock.list.return_value = [ self.identity_sdk_client.service_providers.return_value = [
fakes.FakeResource( self.service_provider
None,
copy.deepcopy(service_fakes.SERVICE_PROVIDER),
loaded=True,
),
] ]
# Get the command object to test # Get the command object to test
@ -225,39 +195,56 @@ class TestServiceProviderList(TestServiceProvider):
# containing the data to be listed. # containing the data to be listed.
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.service_providers_mock.list.assert_called_with() self.identity_sdk_client.service_providers.assert_called_with()
collist = ('ID', 'Enabled', 'Description', 'Auth URL') collist = (
'ID',
'Enabled',
'Description',
'Auth URL',
'Service Provider URL',
'Relay State Prefix',
)
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
( (
service_fakes.sp_id, self.service_provider.id,
True, True,
service_fakes.sp_description, self.service_provider.description,
service_fakes.sp_auth_url, self.service_provider.auth_url,
self.service_provider.sp_url,
self.service_provider.relay_state_prefix,
), ),
) )
self.assertEqual(tuple(data), datalist) self.assertEqual(tuple(data), datalist)
class TestServiceProviderSet(TestServiceProvider): class TestServiceProviderSet(service_fakes.TestFederatedIdentity):
columns = ( columns = (
'auth_url',
'description',
'enabled',
'id', 'id',
'enabled',
'description',
'auth_url',
'sp_url', 'sp_url',
) 'relay_state_prefix',
datalist = (
service_fakes.sp_auth_url,
service_fakes.sp_description,
False,
service_fakes.sp_id,
service_fakes.service_provider_url,
) )
def setUp(self): def setUp(self):
super().setUp() super().setUp()
self.service_provider = sdk_fakes.generate_fake_resource(
_service_provider.ServiceProvider
)
self.identity_sdk_client.update_service_provider.return_value = (
self.service_provider
)
self.data = (
self.service_provider.id,
self.service_provider.is_enabled,
self.service_provider.description,
self.service_provider.auth_url,
self.service_provider.sp_url,
self.service_provider.relay_state_prefix,
)
self.cmd = service_provider.SetServiceProvider(self.app, None) self.cmd = service_provider.SetServiceProvider(self.app, None)
def test_service_provider_disable(self): def test_service_provider_disable(self):
@ -265,144 +252,107 @@ class TestServiceProviderSet(TestServiceProvider):
Set Service Provider's ``enabled`` attribute to False. Set Service Provider's ``enabled`` attribute to False.
""" """
def prepare(self):
"""Prepare fake return objects before the test is executed"""
updated_sp = copy.deepcopy(service_fakes.SERVICE_PROVIDER)
updated_sp['enabled'] = False
resources = fakes.FakeResource(None, updated_sp, loaded=True)
self.service_providers_mock.update.return_value = resources
prepare(self)
arglist = [ arglist = [
'--disable', '--disable',
service_fakes.sp_id, self.service_provider.id,
] ]
verifylist = [ verifylist = [
('service_provider', service_fakes.sp_id), ('service_provider', self.service_provider.id),
('enable', False), ('is_enabled', False),
('disable', True),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.service_providers_mock.update.assert_called_with( self.identity_sdk_client.update_service_provider.assert_called_with(
service_fakes.sp_id, self.service_provider.id,
enabled=False, is_enabled=False,
description=None,
auth_url=None,
sp_url=None,
) )
self.assertEqual(columns, self.columns)
self.assertEqual(data, self.data)
def test_service_provider_enable(self): def test_service_provider_enable(self):
"""Enable Service Provider. """Enable Service Provider.
Set Service Provider's ``enabled`` attribute to True. Set Service Provider's ``enabled`` attribute to True.
""" """
def prepare(self):
"""Prepare fake return objects before the test is executed"""
resources = fakes.FakeResource(
None,
copy.deepcopy(service_fakes.SERVICE_PROVIDER),
loaded=True,
)
self.service_providers_mock.update.return_value = resources
prepare(self)
arglist = [ arglist = [
'--enable', '--enable',
service_fakes.sp_id, self.service_provider.id,
] ]
verifylist = [ verifylist = [
('service_provider', service_fakes.sp_id), ('service_provider', self.service_provider.id),
('enable', True), ('is_enabled', True),
('disable', False),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
self.cmd.take_action(parsed_args) self.identity_sdk_client.update_service_provider.assert_called_with(
self.service_providers_mock.update.assert_called_with( self.service_provider.id,
service_fakes.sp_id, is_enabled=True,
enabled=True,
description=None,
auth_url=None,
sp_url=None,
) )
self.assertEqual(columns, self.columns)
self.assertEqual(data, self.data)
def test_service_provider_no_options(self): def test_service_provider_no_options(self):
def prepare(self):
"""Prepare fake return objects before the test is executed"""
resources = fakes.FakeResource(
None,
copy.deepcopy(service_fakes.SERVICE_PROVIDER),
loaded=True,
)
self.service_providers_mock.get.return_value = resources
resources = fakes.FakeResource(
None,
copy.deepcopy(service_fakes.SERVICE_PROVIDER),
loaded=True,
)
self.service_providers_mock.update.return_value = resources
prepare(self)
arglist = [ arglist = [
service_fakes.sp_id, self.service_provider.id,
] ]
verifylist = [ verifylist = [
('service_provider', service_fakes.sp_id), ('service_provider', self.service_provider.id),
('description', None), ('description', None),
('enable', False), ('is_enabled', None),
('disable', False),
('auth_url', None), ('auth_url', None),
('service_provider_url', None), ('service_provider_url', None),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
self.cmd.take_action(parsed_args) self.assertEqual(columns, self.columns)
self.assertEqual(data, self.data)
class TestServiceProviderShow(TestServiceProvider): class TestServiceProviderShow(service_fakes.TestFederatedIdentity):
def setUp(self): def setUp(self):
super().setUp() super().setUp()
ret = fakes.FakeResource( self.service_provider = sdk_fakes.generate_fake_resource(
None, _service_provider.ServiceProvider
copy.deepcopy(service_fakes.SERVICE_PROVIDER), )
loaded=True, self.identity_sdk_client.find_service_provider.return_value = (
self.service_provider
)
self.data = (
self.service_provider.id,
self.service_provider.is_enabled,
self.service_provider.description,
self.service_provider.auth_url,
self.service_provider.sp_url,
self.service_provider.relay_state_prefix,
) )
self.service_providers_mock.get.side_effect = [
Exception("Not found"),
ret,
]
self.service_providers_mock.get.return_value = ret
# Get the command object to test # Get the command object to test
self.cmd = service_provider.ShowServiceProvider(self.app, None) self.cmd = service_provider.ShowServiceProvider(self.app, None)
def test_service_provider_show(self): def test_service_provider_show(self):
arglist = [ arglist = [
service_fakes.sp_id, self.service_provider.id,
] ]
verifylist = [ verifylist = [
('service_provider', service_fakes.sp_id), ('service_provider', self.service_provider.id),
] ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)
self.service_providers_mock.get.assert_called_with( self.identity_sdk_client.find_service_provider.assert_called_with(
service_fakes.sp_id, id='BETA' self.service_provider.id,
ignore_missing=False,
) )
collist = ('auth_url', 'description', 'enabled', 'id', 'sp_url') collist = (
self.assertEqual(collist, columns) 'id',
datalist = ( 'enabled',
service_fakes.sp_auth_url, 'description',
service_fakes.sp_description, 'auth_url',
True, 'sp_url',
service_fakes.sp_id, 'relay_state_prefix',
service_fakes.service_provider_url,
) )
self.assertEqual(data, datalist) self.assertEqual(collist, columns)
self.assertEqual(data, self.data)

View File

@ -0,0 +1,10 @@
---
upgrade:
- |
The following commands have been migrated to SDK:
- ``service provider create``
- ``service provider delete``
- ``service provider set``
- ``service provider list``
- ``service provider show``