python-openstackclient 8.3.0__py3-none-any.whl → 9.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/common/module.py +1 -1
- openstackclient/common/quota.py +31 -17
- openstackclient/compute/v2/server.py +2 -2
- openstackclient/identity/common.py +31 -0
- openstackclient/identity/v2_0/service.py +3 -1
- openstackclient/identity/v3/federation_protocol.py +39 -40
- openstackclient/identity/v3/limit.py +85 -84
- openstackclient/identity/v3/project.py +181 -112
- openstackclient/identity/v3/registered_limit.py +82 -99
- openstackclient/identity/v3/tag.py +0 -11
- openstackclient/image/v2/image.py +2 -1
- openstackclient/tests/functional/identity/v3/test_limit.py +47 -0
- openstackclient/tests/functional/image/v2/test_metadef_objects.py +69 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +46 -132
- openstackclient/tests/unit/common/test_quota.py +59 -0
- openstackclient/tests/unit/compute/v2/test_server.py +6 -8
- 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/image/v2/test_image.py +5 -5
- 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/v3/test_volume.py +34 -12
- openstackclient/volume/v2/consistency_group.py +8 -8
- openstackclient/volume/v2/consistency_group_snapshot.py +2 -2
- openstackclient/volume/v2/qos_specs.py +2 -2
- openstackclient/volume/v2/volume.py +12 -5
- openstackclient/volume/v2/volume_backup.py +2 -2
- openstackclient/volume/v2/volume_snapshot.py +2 -2
- openstackclient/volume/v2/volume_transfer_request.py +2 -2
- openstackclient/volume/v2/volume_type.py +5 -5
- openstackclient/volume/v3/volume.py +14 -7
- openstackclient/volume/v3/volume_backup.py +2 -2
- openstackclient/volume/v3/volume_snapshot.py +2 -2
- openstackclient/volume/v3/volume_transfer_request.py +2 -2
- openstackclient/volume/v3/volume_type.py +5 -5
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/METADATA +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/RECORD +45 -44
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/licenses/AUTHORS +5 -0
- python_openstackclient-9.0.0.dist-info/pbr.json +1 -0
- python_openstackclient-8.3.0.dist-info/pbr.json +0 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/entry_points.txt +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.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)
|