python-openstackclient 8.3.0__py3-none-any.whl → 10.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/__init__.py +2 -6
- openstackclient/api/api.py +41 -23
- openstackclient/api/compute_v2.py +44 -25
- openstackclient/api/object_store_v1.py +75 -97
- openstackclient/api/volume_v2.py +2 -1
- openstackclient/api/volume_v3.py +2 -1
- openstackclient/common/availability_zone.py +58 -42
- openstackclient/common/clientmanager.py +56 -29
- openstackclient/common/configuration.py +10 -3
- openstackclient/common/envvars.py +2 -2
- openstackclient/common/extension.py +14 -5
- openstackclient/common/limits.py +10 -5
- openstackclient/common/module.py +14 -6
- openstackclient/common/pagination.py +8 -2
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +13 -7
- openstackclient/common/quota.py +126 -114
- openstackclient/common/versions.py +8 -2
- openstackclient/compute/client.py +7 -3
- openstackclient/compute/v2/agent.py +17 -10
- openstackclient/compute/v2/aggregate.py +36 -22
- openstackclient/compute/v2/console.py +14 -8
- openstackclient/compute/v2/console_connection.py +11 -3
- openstackclient/compute/v2/flavor.py +39 -21
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +14 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +29 -14
- openstackclient/compute/v2/server.py +251 -171
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +21 -12
- openstackclient/compute/v2/server_group.py +21 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +24 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +10 -4
- openstackclient/compute/v2/service.py +14 -7
- openstackclient/compute/v2/usage.py +26 -21
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +103 -41
- openstackclient/identity/v2_0/catalog.py +14 -7
- openstackclient/identity/v2_0/ec2creds.py +21 -10
- openstackclient/identity/v2_0/endpoint.py +23 -11
- openstackclient/identity/v2_0/project.py +25 -14
- openstackclient/identity/v2_0/role.py +28 -14
- openstackclient/identity/v2_0/role_assignment.py +9 -3
- openstackclient/identity/v2_0/service.py +26 -12
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +26 -12
- openstackclient/identity/v3/application_credential.py +59 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +36 -16
- openstackclient/identity/v3/domain.py +37 -18
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +42 -20
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +71 -50
- openstackclient/identity/v3/group.py +55 -32
- openstackclient/identity/v3/identity_provider.py +92 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +115 -92
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +211 -122
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +116 -109
- openstackclient/identity/v3/role.py +61 -31
- openstackclient/identity/v3/role_assignment.py +23 -6
- openstackclient/identity/v3/service.py +36 -16
- openstackclient/identity/v3/service_provider.py +37 -15
- openstackclient/identity/v3/tag.py +23 -17
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +32 -14
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +49 -26
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +14 -9
- openstackclient/image/v2/image.py +76 -49
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +109 -13
- openstackclient/image/v2/metadef_objects.py +28 -15
- openstackclient/image/v2/metadef_properties.py +24 -13
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +15 -6
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
- openstackclient/network/client.py +7 -2
- openstackclient/network/common.py +16 -241
- openstackclient/network/utils.py +36 -22
- openstackclient/network/v2/address_group.py +27 -16
- openstackclient/network/v2/address_scope.py +24 -13
- openstackclient/network/v2/bgpvpn/bgpvpn.py +463 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +214 -0
- openstackclient/network/v2/bgpvpn/port_association.py +490 -0
- openstackclient/network/v2/bgpvpn/router_association.py +288 -0
- openstackclient/network/v2/default_security_group_rule.py +19 -10
- openstackclient/network/v2/floating_ip.py +110 -159
- openstackclient/network/v2/floating_ip_port_forwarding.py +30 -18
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +466 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +574 -0
- openstackclient/network/v2/ip_availability.py +13 -5
- openstackclient/network/v2/l3_conntrack_helper.py +22 -13
- openstackclient/network/v2/local_ip.py +24 -13
- openstackclient/network/v2/local_ip_association.py +14 -7
- openstackclient/network/v2/ndp_proxy.py +20 -11
- openstackclient/network/v2/network.py +129 -196
- openstackclient/network/v2/network_agent.py +46 -25
- openstackclient/network/v2/network_auto_allocated_topology.py +22 -11
- openstackclient/network/v2/network_flavor.py +27 -16
- openstackclient/network/v2/network_flavor_profile.py +23 -12
- openstackclient/network/v2/network_meter.py +21 -10
- openstackclient/network/v2/network_meter_rule.py +21 -11
- openstackclient/network/v2/network_qos_policy.py +25 -15
- openstackclient/network/v2/network_qos_rule.py +32 -17
- openstackclient/network/v2/network_qos_rule_type.py +13 -5
- openstackclient/network/v2/network_rbac.py +23 -12
- openstackclient/network/v2/network_segment.py +20 -11
- openstackclient/network/v2/network_segment_range.py +56 -29
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +38 -22
- openstackclient/network/v2/port.py +54 -29
- openstackclient/network/v2/router.py +75 -52
- openstackclient/network/v2/security_group.py +87 -157
- openstackclient/network/v2/security_group_rule.py +100 -280
- openstackclient/network/v2/subnet.py +49 -28
- openstackclient/network/v2/subnet_pool.py +30 -17
- openstackclient/network/v2/taas/tap_flow.py +22 -11
- openstackclient/network/v2/taas/tap_mirror.py +22 -11
- openstackclient/network/v2/taas/tap_service.py +23 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +25 -15
- openstackclient/object/v1/object.py +25 -15
- openstackclient/py.typed +0 -0
- openstackclient/shell.py +46 -10
- openstackclient/tests/functional/base.py +55 -20
- openstackclient/tests/functional/common/test_extension.py +4 -0
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +14 -13
- openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
- openstackclient/tests/functional/compute/v2/test_server.py +3 -0
- openstackclient/tests/functional/identity/v2/common.py +10 -6
- openstackclient/tests/functional/identity/v2/test_role.py +4 -4
- openstackclient/tests/functional/identity/v3/common.py +25 -19
- openstackclient/tests/functional/identity/v3/test_group.py +20 -20
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
- openstackclient/tests/functional/identity/v3/test_limit.py +47 -0
- openstackclient/tests/functional/identity/v3/test_project.py +10 -10
- openstackclient/tests/functional/identity/v3/test_role.py +18 -18
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/image/base.py +1 -6
- openstackclient/tests/functional/image/v2/test_metadef_objects.py +69 -0
- openstackclient/tests/functional/network/v2/common.py +5 -2
- openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
- openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
- openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
- openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
- openstackclient/tests/functional/object/v1/common.py +4 -0
- openstackclient/tests/functional/volume/v2/common.py +4 -0
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
- openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
- openstackclient/tests/functional/volume/v3/common.py +4 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +56 -138
- openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
- openstackclient/tests/unit/common/test_availability_zone.py +35 -49
- openstackclient/tests/unit/common/test_extension.py +2 -2
- openstackclient/tests/unit/common/test_module.py +12 -7
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +62 -23
- openstackclient/tests/unit/compute/v2/fakes.py +25 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +28 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +6 -6
- openstackclient/tests/unit/compute/v2/test_server.py +17 -104
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/identity/v3/fakes.py +3 -0
- openstackclient/tests/unit/identity/v3/test_group.py +4 -14
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_limit.py +197 -145
- openstackclient/tests/unit/identity/v3/test_project.py +831 -512
- openstackclient/tests/unit/identity/v3/test_protocol.py +97 -88
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +355 -220
- openstackclient/tests/unit/identity/v3/test_user.py +4 -4
- openstackclient/tests/unit/image/v2/test_image.py +16 -16
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
- openstackclient/tests/unit/network/test_common.py +0 -155
- openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +897 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +980 -0
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
- openstackclient/tests/unit/network/v2/test_address_group.py +2 -2
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +3 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_agent.py +8 -4
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_rbac.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +7 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_router.py +8 -9
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +1 -20
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +7 -41
- openstackclient/tests/unit/network/v2/test_subnet.py +2 -1
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +2 -1
- openstackclient/tests/unit/object/v1/fakes.py +8 -7
- openstackclient/tests/unit/object/v1/test_container.py +65 -101
- openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
- openstackclient/tests/unit/object/v1/test_object.py +44 -84
- openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
- openstackclient/tests/unit/test_hacking.py +108 -0
- openstackclient/tests/unit/volume/v2/fakes.py +1 -0
- openstackclient/tests/unit/volume/v2/test_consistency_group.py +8 -2
- openstackclient/tests/unit/volume/v2/test_volume.py +7 -6
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +2 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +1 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +94 -15
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +55 -1
- openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
- openstackclient/volume/client.py +7 -3
- openstackclient/volume/v2/backup_record.py +15 -6
- openstackclient/volume/v2/consistency_group.py +37 -25
- openstackclient/volume/v2/consistency_group_snapshot.py +27 -12
- openstackclient/volume/v2/qos_specs.py +30 -19
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +69 -34
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -22
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +52 -26
- openstackclient/volume/v2/volume_transfer_request.py +33 -15
- openstackclient/volume/v2/volume_type.py +46 -27
- openstackclient/volume/v3/block_storage_cleanup.py +11 -3
- openstackclient/volume/v3/block_storage_cluster.py +19 -7
- openstackclient/volume/v3/block_storage_log_level.py +15 -6
- openstackclient/volume/v3/block_storage_manage.py +10 -4
- openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +103 -46
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +55 -26
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +32 -13
- openstackclient/volume/v3/volume_group_type.py +26 -13
- openstackclient/volume/v3/volume_message.py +15 -7
- openstackclient/volume/v3/volume_snapshot.py +71 -34
- openstackclient/volume/v3/volume_transfer_request.py +33 -15
- openstackclient/volume/v3/volume_type.py +45 -27
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +279 -267
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.0.0.dist-info/pbr.json +1 -0
- openstackclient/api/image_v1.py +0 -69
- openstackclient/api/image_v2.py +0 -79
- openstackclient/network/v2/floating_ip_pool.py +0 -38
- openstackclient/tests/functional/image/v1/test_image.py +0 -97
- openstackclient/tests/unit/api/test_image_v1.py +0 -96
- openstackclient/tests/unit/api/test_image_v2.py +0 -96
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
- openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
- python_openstackclient-8.3.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -12,202 +12,211 @@
|
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
|
13
13
|
# under the License.
|
|
14
14
|
|
|
15
|
-
import
|
|
16
|
-
|
|
15
|
+
from openstack.identity.v3 import federation_protocol as _federation_protocol
|
|
16
|
+
from openstack.identity.v3 import mapping as _mapping
|
|
17
|
+
from openstack.test import fakes as sdk_fakes
|
|
17
18
|
from openstackclient.identity.v3 import federation_protocol
|
|
18
|
-
from openstackclient.tests.unit import fakes
|
|
19
19
|
from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class
|
|
23
|
-
def setUp(self):
|
|
24
|
-
super().setUp()
|
|
25
|
-
|
|
26
|
-
federation_lib = self.identity_client.federation
|
|
27
|
-
self.protocols_mock = federation_lib.protocols
|
|
28
|
-
self.protocols_mock.reset_mock()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class TestProtocolCreate(TestProtocol):
|
|
22
|
+
class TestProtocolCreate(identity_fakes.TestFederatedIdentity):
|
|
32
23
|
def setUp(self):
|
|
33
24
|
super().setUp()
|
|
34
25
|
|
|
35
|
-
proto =
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
self.proto = sdk_fakes.generate_fake_resource(
|
|
27
|
+
_federation_protocol.FederationProtocol
|
|
28
|
+
)
|
|
29
|
+
self.identity_sdk_client.create_federation_protocol.return_value = (
|
|
30
|
+
self.proto
|
|
31
|
+
)
|
|
38
32
|
self.cmd = federation_protocol.CreateProtocol(self.app, None)
|
|
39
33
|
|
|
40
34
|
def test_create_protocol(self):
|
|
41
35
|
argslist = [
|
|
42
|
-
|
|
36
|
+
self.proto.name,
|
|
43
37
|
'--identity-provider',
|
|
44
|
-
|
|
38
|
+
self.proto.idp_id,
|
|
45
39
|
'--mapping',
|
|
46
|
-
|
|
40
|
+
self.proto.mapping_id,
|
|
47
41
|
]
|
|
48
42
|
|
|
49
43
|
verifylist = [
|
|
50
|
-
('federation_protocol',
|
|
51
|
-
('identity_provider',
|
|
52
|
-
('mapping',
|
|
44
|
+
('federation_protocol', self.proto.name),
|
|
45
|
+
('identity_provider', self.proto.idp_id),
|
|
46
|
+
('mapping', self.proto.mapping_id),
|
|
53
47
|
]
|
|
54
48
|
parsed_args = self.check_parser(self.cmd, argslist, verifylist)
|
|
55
49
|
columns, data = self.cmd.take_action(parsed_args)
|
|
56
|
-
self.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
self.identity_sdk_client.create_federation_protocol.assert_called_with(
|
|
51
|
+
name=self.proto.id,
|
|
52
|
+
idp_id=self.proto.idp_id,
|
|
53
|
+
mapping_id=self.proto.mapping_id,
|
|
60
54
|
)
|
|
61
55
|
|
|
62
56
|
collist = ('id', 'identity_provider', 'mapping')
|
|
63
57
|
self.assertEqual(collist, columns)
|
|
64
58
|
|
|
65
59
|
datalist = (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
self.proto.id,
|
|
61
|
+
self.proto.idp_id,
|
|
62
|
+
self.proto.mapping_id,
|
|
69
63
|
)
|
|
70
64
|
self.assertEqual(datalist, data)
|
|
71
65
|
|
|
72
66
|
|
|
73
|
-
class TestProtocolDelete(
|
|
67
|
+
class TestProtocolDelete(identity_fakes.TestFederatedIdentity):
|
|
74
68
|
def setUp(self):
|
|
75
69
|
super().setUp()
|
|
76
70
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
None,
|
|
80
|
-
copy.deepcopy(identity_fakes.PROTOCOL_OUTPUT),
|
|
81
|
-
loaded=True,
|
|
71
|
+
self.proto = sdk_fakes.generate_fake_resource(
|
|
72
|
+
_federation_protocol.FederationProtocol
|
|
82
73
|
)
|
|
83
|
-
|
|
84
|
-
self.protocols_mock.delete.return_value = None
|
|
74
|
+
self.identity_sdk_client.delete_federation_protocol.return_value = None
|
|
85
75
|
self.cmd = federation_protocol.DeleteProtocol(self.app, None)
|
|
86
76
|
|
|
87
|
-
def
|
|
77
|
+
def test_delete_protocol(self):
|
|
88
78
|
arglist = [
|
|
89
79
|
'--identity-provider',
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
self.proto.idp_id,
|
|
81
|
+
self.proto.name,
|
|
92
82
|
]
|
|
93
83
|
verifylist = [
|
|
94
|
-
('federation_protocol', [
|
|
95
|
-
('identity_provider',
|
|
84
|
+
('federation_protocol', [self.proto.id]),
|
|
85
|
+
('identity_provider', self.proto.idp_id),
|
|
96
86
|
]
|
|
97
87
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
98
88
|
|
|
99
89
|
result = self.cmd.take_action(parsed_args)
|
|
100
90
|
|
|
101
|
-
self.
|
|
102
|
-
|
|
91
|
+
self.identity_sdk_client.delete_federation_protocol.assert_called_with(
|
|
92
|
+
idp_id=self.proto.idp_id,
|
|
93
|
+
protocol=self.proto.id,
|
|
94
|
+
ignore_missing=False,
|
|
103
95
|
)
|
|
104
96
|
self.assertIsNone(result)
|
|
105
97
|
|
|
106
98
|
|
|
107
|
-
class TestProtocolList(
|
|
99
|
+
class TestProtocolList(identity_fakes.TestFederatedIdentity):
|
|
108
100
|
def setUp(self):
|
|
109
101
|
super().setUp()
|
|
110
102
|
|
|
111
|
-
self.
|
|
112
|
-
|
|
103
|
+
self.proto1 = sdk_fakes.generate_fake_resource(
|
|
104
|
+
_federation_protocol.FederationProtocol
|
|
113
105
|
)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
self.proto2 = sdk_fakes.generate_fake_resource(
|
|
107
|
+
_federation_protocol.FederationProtocol, idp_id=self.proto1
|
|
108
|
+
)
|
|
109
|
+
self.identity_sdk_client.federation_protocols.return_value = [
|
|
110
|
+
self.proto1,
|
|
111
|
+
self.proto2,
|
|
119
112
|
]
|
|
120
|
-
|
|
121
113
|
self.cmd = federation_protocol.ListProtocols(self.app, None)
|
|
122
114
|
|
|
123
115
|
def test_list_protocols(self):
|
|
124
|
-
arglist = ['--identity-provider',
|
|
125
|
-
verifylist = [('identity_provider',
|
|
116
|
+
arglist = ['--identity-provider', self.proto1.idp_id]
|
|
117
|
+
verifylist = [('identity_provider', self.proto1.idp_id)]
|
|
126
118
|
|
|
127
119
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
128
120
|
columns, data = self.cmd.take_action(parsed_args)
|
|
129
121
|
|
|
130
|
-
self.
|
|
122
|
+
self.identity_sdk_client.federation_protocols.assert_called_with(
|
|
123
|
+
self.proto1.idp_id
|
|
124
|
+
)
|
|
131
125
|
|
|
126
|
+
self.assertEqual(columns, ('id', 'mapping'))
|
|
127
|
+
datalist = (
|
|
128
|
+
(
|
|
129
|
+
self.proto1.name,
|
|
130
|
+
self.proto1.mapping_id,
|
|
131
|
+
),
|
|
132
|
+
(
|
|
133
|
+
self.proto2.name,
|
|
134
|
+
self.proto2.mapping_id,
|
|
135
|
+
),
|
|
136
|
+
)
|
|
137
|
+
self.assertEqual(datalist, tuple(data))
|
|
132
138
|
|
|
133
|
-
|
|
139
|
+
|
|
140
|
+
class TestProtocolSet(identity_fakes.TestFederatedIdentity):
|
|
134
141
|
def setUp(self):
|
|
135
142
|
super().setUp()
|
|
136
|
-
self.
|
|
137
|
-
|
|
143
|
+
self.proto = sdk_fakes.generate_fake_resource(
|
|
144
|
+
_federation_protocol.FederationProtocol
|
|
138
145
|
)
|
|
139
|
-
self.
|
|
140
|
-
|
|
146
|
+
self.mapping = sdk_fakes.generate_fake_resource(_mapping.Mapping)
|
|
147
|
+
self.identity_sdk_client.update_federation_protocol.return_value = (
|
|
148
|
+
self.proto
|
|
141
149
|
)
|
|
142
|
-
|
|
143
150
|
self.cmd = federation_protocol.SetProtocol(self.app, None)
|
|
144
151
|
|
|
145
152
|
def test_set_new_mapping(self):
|
|
146
153
|
arglist = [
|
|
147
|
-
|
|
154
|
+
self.proto.name,
|
|
148
155
|
'--identity-provider',
|
|
149
|
-
|
|
156
|
+
self.proto.idp_id,
|
|
150
157
|
'--mapping',
|
|
151
|
-
|
|
158
|
+
self.mapping.name,
|
|
152
159
|
]
|
|
153
160
|
verifylist = [
|
|
154
|
-
('identity_provider',
|
|
155
|
-
('federation_protocol',
|
|
156
|
-
('mapping',
|
|
161
|
+
('identity_provider', self.proto.idp_id),
|
|
162
|
+
('federation_protocol', self.proto.name),
|
|
163
|
+
('mapping', self.mapping.name),
|
|
157
164
|
]
|
|
158
165
|
|
|
159
166
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
160
167
|
columns, data = self.cmd.take_action(parsed_args)
|
|
161
168
|
|
|
162
|
-
self.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
169
|
+
self.identity_sdk_client.update_federation_protocol.assert_called_with(
|
|
170
|
+
idp_id=self.proto.idp_id,
|
|
171
|
+
name=self.proto.name,
|
|
172
|
+
mapping_id=self.mapping.id,
|
|
166
173
|
)
|
|
167
174
|
|
|
168
175
|
collist = ('id', 'identity_provider', 'mapping')
|
|
169
176
|
self.assertEqual(collist, columns)
|
|
170
177
|
|
|
171
178
|
datalist = (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
179
|
+
self.proto.name,
|
|
180
|
+
self.proto.idp_id,
|
|
181
|
+
self.proto.mapping_id,
|
|
175
182
|
)
|
|
176
183
|
self.assertEqual(datalist, data)
|
|
177
184
|
|
|
178
185
|
|
|
179
|
-
class TestProtocolShow(
|
|
186
|
+
class TestProtocolShow(identity_fakes.TestFederatedIdentity):
|
|
180
187
|
def setUp(self):
|
|
181
188
|
super().setUp()
|
|
182
|
-
self.
|
|
183
|
-
|
|
189
|
+
self.proto = sdk_fakes.generate_fake_resource(
|
|
190
|
+
_federation_protocol.FederationProtocol
|
|
191
|
+
)
|
|
192
|
+
self.identity_sdk_client.get_federation_protocol.return_value = (
|
|
193
|
+
self.proto
|
|
184
194
|
)
|
|
185
|
-
|
|
186
195
|
self.cmd = federation_protocol.ShowProtocol(self.app, None)
|
|
187
196
|
|
|
188
197
|
def test_show_protocol(self):
|
|
189
198
|
arglist = [
|
|
190
|
-
|
|
199
|
+
self.proto.name,
|
|
191
200
|
'--identity-provider',
|
|
192
|
-
|
|
201
|
+
self.proto.idp_id,
|
|
193
202
|
]
|
|
194
203
|
verifylist = [
|
|
195
|
-
('federation_protocol',
|
|
196
|
-
('identity_provider',
|
|
204
|
+
('federation_protocol', self.proto.name),
|
|
205
|
+
('identity_provider', self.proto.idp_id),
|
|
197
206
|
]
|
|
198
207
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
199
208
|
|
|
200
209
|
columns, data = self.cmd.take_action(parsed_args)
|
|
201
|
-
self.
|
|
202
|
-
|
|
210
|
+
self.identity_sdk_client.get_federation_protocol.assert_called_with(
|
|
211
|
+
idp_id=self.proto.idp_id, protocol=self.proto.name
|
|
203
212
|
)
|
|
204
213
|
|
|
205
214
|
collist = ('id', 'identity_provider', 'mapping')
|
|
206
215
|
self.assertEqual(collist, columns)
|
|
207
216
|
|
|
208
217
|
datalist = (
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
218
|
+
self.proto.name,
|
|
219
|
+
self.proto.idp_id,
|
|
220
|
+
self.proto.mapping_id,
|
|
212
221
|
)
|
|
213
222
|
self.assertEqual(datalist, data)
|