python-openstackclient 8.2.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/api/object_store_v1.py +4 -1
- openstackclient/command.py +27 -0
- openstackclient/common/availability_zone.py +1 -1
- openstackclient/common/clientmanager.py +59 -21
- openstackclient/common/configuration.py +1 -1
- openstackclient/common/extension.py +1 -1
- openstackclient/common/limits.py +1 -1
- openstackclient/common/module.py +5 -3
- openstackclient/common/project_cleanup.py +10 -8
- openstackclient/common/quota.py +54 -23
- openstackclient/common/versions.py +1 -2
- openstackclient/compute/v2/agent.py +1 -1
- openstackclient/compute/v2/aggregate.py +6 -5
- openstackclient/compute/v2/console.py +5 -3
- openstackclient/compute/v2/console_connection.py +1 -1
- openstackclient/compute/v2/flavor.py +1 -1
- openstackclient/compute/v2/host.py +1 -1
- openstackclient/compute/v2/hypervisor.py +1 -1
- openstackclient/compute/v2/hypervisor_stats.py +1 -1
- openstackclient/compute/v2/keypair.py +1 -1
- openstackclient/compute/v2/server.py +78 -29
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +1 -1
- openstackclient/compute/v2/server_group.py +4 -2
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +1 -1
- openstackclient/compute/v2/server_volume.py +1 -1
- openstackclient/compute/v2/service.py +1 -1
- openstackclient/compute/v2/usage.py +6 -4
- openstackclient/identity/common.py +33 -1
- openstackclient/identity/v2_0/catalog.py +3 -2
- openstackclient/identity/v2_0/ec2creds.py +1 -1
- openstackclient/identity/v2_0/endpoint.py +1 -1
- openstackclient/identity/v2_0/project.py +17 -7
- openstackclient/identity/v2_0/role.py +1 -1
- openstackclient/identity/v2_0/role_assignment.py +3 -3
- openstackclient/identity/v2_0/service.py +4 -2
- openstackclient/identity/v2_0/token.py +1 -1
- openstackclient/identity/v2_0/user.py +2 -2
- openstackclient/identity/v3/access_rule.py +16 -4
- openstackclient/identity/v3/application_credential.py +30 -10
- openstackclient/identity/v3/catalog.py +3 -3
- openstackclient/identity/v3/consumer.py +1 -1
- openstackclient/identity/v3/credential.py +1 -1
- openstackclient/identity/v3/domain.py +10 -4
- openstackclient/identity/v3/ec2creds.py +1 -1
- openstackclient/identity/v3/endpoint.py +33 -12
- openstackclient/identity/v3/endpoint_group.py +1 -1
- openstackclient/identity/v3/federation_protocol.py +40 -41
- openstackclient/identity/v3/group.py +11 -5
- openstackclient/identity/v3/identity_provider.py +12 -10
- openstackclient/identity/v3/implied_role.py +1 -1
- openstackclient/identity/v3/limit.py +86 -85
- openstackclient/identity/v3/mapping.py +1 -1
- openstackclient/identity/v3/policy.py +1 -1
- openstackclient/identity/v3/project.py +191 -115
- openstackclient/identity/v3/region.py +1 -1
- openstackclient/identity/v3/registered_limit.py +97 -109
- openstackclient/identity/v3/role.py +20 -39
- openstackclient/identity/v3/role_assignment.py +12 -23
- openstackclient/identity/v3/service.py +1 -1
- openstackclient/identity/v3/service_provider.py +1 -1
- openstackclient/identity/v3/tag.py +1 -11
- openstackclient/identity/v3/token.py +3 -2
- openstackclient/identity/v3/trust.py +4 -2
- openstackclient/identity/v3/unscoped_saml.py +1 -1
- openstackclient/identity/v3/user.py +22 -13
- openstackclient/image/v1/image.py +19 -16
- openstackclient/image/v2/cache.py +1 -1
- openstackclient/image/v2/image.py +16 -12
- openstackclient/image/v2/info.py +1 -1
- openstackclient/image/v2/metadef_namespaces.py +1 -1
- openstackclient/image/v2/metadef_objects.py +1 -1
- openstackclient/image/v2/metadef_properties.py +3 -2
- openstackclient/image/v2/metadef_resource_type_association.py +1 -1
- openstackclient/image/v2/metadef_resource_types.py +1 -1
- openstackclient/image/v2/task.py +1 -1
- openstackclient/network/common.py +10 -9
- openstackclient/network/v2/address_group.py +4 -3
- openstackclient/network/v2/address_scope.py +8 -6
- openstackclient/network/v2/default_security_group_rule.py +9 -8
- openstackclient/network/v2/floating_ip.py +16 -9
- openstackclient/network/v2/floating_ip_port_forwarding.py +9 -6
- openstackclient/network/v2/ip_availability.py +7 -4
- openstackclient/network/v2/l3_conntrack_helper.py +11 -4
- openstackclient/network/v2/local_ip.py +13 -7
- openstackclient/network/v2/local_ip_association.py +7 -4
- openstackclient/network/v2/ndp_proxy.py +13 -6
- openstackclient/network/v2/network.py +33 -16
- openstackclient/network/v2/network_agent.py +5 -5
- openstackclient/network/v2/network_auto_allocated_topology.py +1 -1
- openstackclient/network/v2/network_flavor.py +1 -1
- openstackclient/network/v2/network_flavor_profile.py +1 -1
- openstackclient/network/v2/network_meter.py +1 -1
- openstackclient/network/v2/network_meter_rule.py +1 -1
- openstackclient/network/v2/network_qos_policy.py +7 -5
- openstackclient/network/v2/network_qos_rule.py +1 -1
- openstackclient/network/v2/network_qos_rule_type.py +1 -1
- openstackclient/network/v2/network_rbac.py +8 -5
- openstackclient/network/v2/network_segment.py +2 -2
- openstackclient/network/v2/network_segment_range.py +13 -6
- openstackclient/network/v2/network_service_provider.py +1 -1
- openstackclient/network/v2/network_trunk.py +65 -42
- openstackclient/network/v2/port.py +22 -20
- openstackclient/network/v2/router.py +19 -8
- openstackclient/network/v2/security_group.py +10 -6
- openstackclient/network/v2/security_group_rule.py +11 -5
- openstackclient/network/v2/subnet.py +17 -18
- openstackclient/network/v2/subnet_pool.py +11 -9
- openstackclient/network/v2/taas/__init__.py +0 -0
- openstackclient/network/v2/taas/tap_flow.py +245 -0
- openstackclient/network/v2/taas/tap_mirror.py +237 -0
- openstackclient/network/v2/taas/tap_service.py +211 -0
- openstackclient/object/v1/account.py +1 -1
- openstackclient/object/v1/container.py +1 -1
- openstackclient/object/v1/object.py +1 -1
- openstackclient/shell.py +18 -8
- openstackclient/tests/functional/identity/v3/test_catalog.py +42 -23
- openstackclient/tests/functional/identity/v3/test_limit.py +47 -0
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +174 -0
- openstackclient/tests/functional/image/v2/test_cache.py +54 -0
- openstackclient/tests/functional/image/v2/test_metadef_objects.py +69 -0
- openstackclient/tests/functional/image/v2/test_metadef_resource_type.py +55 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +46 -132
- openstackclient/tests/unit/common/test_command.py +1 -1
- openstackclient/tests/unit/common/test_extension.py +2 -3
- openstackclient/tests/unit/common/test_module.py +14 -7
- openstackclient/tests/unit/common/test_quota.py +79 -0
- openstackclient/tests/unit/compute/v2/test_aggregate.py +5 -3
- openstackclient/tests/unit/compute/v2/test_console.py +1 -4
- openstackclient/tests/unit/compute/v2/test_flavor.py +1 -3
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +1 -9
- openstackclient/tests/unit/compute/v2/test_server.py +370 -38
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -3
- openstackclient/tests/unit/compute/v2/test_service.py +1 -3
- openstackclient/tests/unit/fakes.py +35 -134
- openstackclient/tests/unit/identity/test_common.py +100 -0
- openstackclient/tests/unit/identity/v2_0/test_project.py +4 -4
- openstackclient/tests/unit/identity/v3/fakes.py +10 -2
- openstackclient/tests/unit/identity/v3/test_application_credential.py +3 -3
- openstackclient/tests/unit/identity/v3/test_domain.py +1 -1
- openstackclient/tests/unit/identity/v3/test_endpoint.py +1 -1
- openstackclient/tests/unit/identity/v3/test_group.py +4 -2
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +10 -10
- openstackclient/tests/unit/identity/v3/test_limit.py +197 -145
- openstackclient/tests/unit/identity/v3/test_oauth.py +1 -1
- openstackclient/tests/unit/identity/v3/test_project.py +832 -513
- openstackclient/tests/unit/identity/v3/test_protocol.py +97 -88
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +356 -221
- openstackclient/tests/unit/identity/v3/test_role.py +1 -82
- openstackclient/tests/unit/identity/v3/test_user.py +7 -51
- openstackclient/tests/unit/image/v2/test_image.py +116 -5
- openstackclient/tests/unit/network/test_common.py +9 -13
- openstackclient/tests/unit/network/v2/taas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/taas/test_osc_tap_flow.py +276 -0
- openstackclient/tests/unit/network/v2/taas/test_osc_tap_mirror.py +288 -0
- openstackclient/tests/unit/network/v2/taas/test_osc_tap_service.py +271 -0
- openstackclient/tests/unit/network/v2/test_address_group.py +19 -22
- openstackclient/tests/unit/network/v2/test_address_scope.py +10 -15
- openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +38 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +21 -27
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +21 -18
- openstackclient/tests/unit/network/v2/test_ip_availability.py +6 -8
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +6 -15
- openstackclient/tests/unit/network/v2/test_local_ip.py +12 -23
- openstackclient/tests/unit/network/v2/test_local_ip_association.py +13 -18
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +11 -21
- openstackclient/tests/unit/network/v2/test_network.py +41 -37
- openstackclient/tests/unit/network/v2/test_network_agent.py +13 -20
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +5 -8
- openstackclient/tests/unit/network/v2/test_network_flavor.py +14 -26
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +14 -17
- openstackclient/tests/unit/network/v2/test_network_meter.py +7 -17
- openstackclient/tests/unit/network/v2/test_network_meter_rule.py +10 -20
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +7 -13
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +44 -54
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +2 -7
- openstackclient/tests/unit/network/v2/test_network_rbac.py +21 -36
- openstackclient/tests/unit/network/v2/test_network_segment.py +13 -29
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +20 -19
- openstackclient/tests/unit/network/v2/test_network_service_provider.py +1 -4
- openstackclient/tests/unit/network/v2/test_network_trunk.py +52 -47
- openstackclient/tests/unit/network/v2/test_port.py +75 -86
- openstackclient/tests/unit/network/v2/test_router.py +104 -126
- openstackclient/tests/unit/network/v2/test_security_group_network.py +19 -26
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +17 -18
- openstackclient/tests/unit/network/v2/test_subnet.py +35 -46
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +21 -33
- openstackclient/tests/unit/volume/test_find_resource.py +4 -13
- 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 +3 -1
- openstackclient/tests/unit/volume/v3/test_volume.py +38 -12
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +9 -0
- openstackclient/volume/client.py +7 -17
- openstackclient/volume/v2/backup_record.py +1 -1
- openstackclient/volume/v2/consistency_group.py +9 -9
- openstackclient/volume/v2/consistency_group_snapshot.py +3 -3
- openstackclient/volume/v2/qos_specs.py +3 -3
- openstackclient/volume/v2/service.py +1 -1
- openstackclient/volume/v2/volume.py +14 -7
- openstackclient/volume/v2/volume_backend.py +1 -1
- openstackclient/volume/v2/volume_backup.py +7 -5
- openstackclient/volume/v2/volume_host.py +1 -2
- openstackclient/volume/v2/volume_snapshot.py +4 -4
- openstackclient/volume/v2/volume_transfer_request.py +3 -3
- openstackclient/volume/v2/volume_type.py +16 -11
- openstackclient/volume/v3/block_storage_cleanup.py +1 -1
- openstackclient/volume/v3/block_storage_cluster.py +1 -1
- openstackclient/volume/v3/block_storage_log_level.py +1 -1
- openstackclient/volume/v3/block_storage_manage.py +1 -1
- openstackclient/volume/v3/block_storage_resource_filter.py +1 -1
- openstackclient/volume/v3/service.py +1 -1
- openstackclient/volume/v3/volume.py +16 -9
- openstackclient/volume/v3/volume_attachment.py +6 -5
- openstackclient/volume/v3/volume_backup.py +20 -5
- openstackclient/volume/v3/volume_group.py +1 -1
- openstackclient/volume/v3/volume_group_snapshot.py +1 -1
- openstackclient/volume/v3/volume_group_type.py +1 -1
- openstackclient/volume/v3/volume_message.py +1 -1
- openstackclient/volume/v3/volume_snapshot.py +4 -4
- openstackclient/volume/v3/volume_transfer_request.py +3 -3
- openstackclient/volume/v3/volume_type.py +20 -14
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-9.0.0.dist-info}/METADATA +15 -13
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-9.0.0.dist-info}/RECORD +231 -219
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-9.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-9.0.0.dist-info}/entry_points.txt +15 -0
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-9.0.0.dist-info/licenses}/AUTHORS +15 -0
- python_openstackclient-9.0.0.dist-info/pbr.json +1 -0
- openstackclient/tests/unit/common/test_logs.py +0 -221
- python_openstackclient-8.2.0.dist-info/pbr.json +0 -1
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-9.0.0.dist-info/licenses}/LICENSE +0 -0
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-9.0.0.dist-info}/top_level.txt +0 -0
|
@@ -11,11 +11,9 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
#
|
|
13
13
|
|
|
14
|
-
from unittest import mock
|
|
15
14
|
from unittest.mock import call
|
|
16
15
|
import uuid
|
|
17
16
|
|
|
18
|
-
from openstack.network.v2 import _proxy
|
|
19
17
|
from openstack.network.v2 import (
|
|
20
18
|
default_security_group_rule as _default_security_group_rule,
|
|
21
19
|
)
|
|
@@ -28,18 +26,7 @@ from openstackclient.tests.unit.network.v2 import fakes as network_fakes
|
|
|
28
26
|
from openstackclient.tests.unit import utils as tests_utils
|
|
29
27
|
|
|
30
28
|
|
|
31
|
-
class
|
|
32
|
-
def setUp(self):
|
|
33
|
-
super().setUp()
|
|
34
|
-
|
|
35
|
-
self.app.client_manager.sdk_connection = mock.Mock()
|
|
36
|
-
self.app.client_manager.sdk_connection.network = mock.Mock(
|
|
37
|
-
spec=_proxy.Proxy,
|
|
38
|
-
)
|
|
39
|
-
self.sdk_client = self.app.client_manager.sdk_connection.network
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
29
|
+
class TestCreateDefaultSecurityGroupRule(network_fakes.TestNetworkV2):
|
|
43
30
|
expected_columns = (
|
|
44
31
|
'description',
|
|
45
32
|
'direction',
|
|
@@ -82,7 +69,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
82
69
|
**default_security_group_rule_attrs,
|
|
83
70
|
)
|
|
84
71
|
|
|
85
|
-
self.
|
|
72
|
+
self.network_client.create_default_security_group_rule.return_value = (
|
|
86
73
|
self._default_sg_rule
|
|
87
74
|
)
|
|
88
75
|
self.expected_data = (
|
|
@@ -208,7 +195,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
208
195
|
|
|
209
196
|
columns, data = self.cmd.take_action(parsed_args)
|
|
210
197
|
|
|
211
|
-
self.
|
|
198
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
212
199
|
**{
|
|
213
200
|
'direction': self._default_sg_rule.direction,
|
|
214
201
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -252,7 +239,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
252
239
|
|
|
253
240
|
columns, data = self.cmd.take_action(parsed_args)
|
|
254
241
|
|
|
255
|
-
self.
|
|
242
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
256
243
|
**{
|
|
257
244
|
'direction': self._default_sg_rule.direction,
|
|
258
245
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -302,7 +289,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
302
289
|
|
|
303
290
|
columns, data = self.cmd.take_action(parsed_args)
|
|
304
291
|
|
|
305
|
-
self.
|
|
292
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
306
293
|
**{
|
|
307
294
|
'direction': self._default_sg_rule.direction,
|
|
308
295
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -347,7 +334,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
347
334
|
|
|
348
335
|
columns, data = self.cmd.take_action(parsed_args)
|
|
349
336
|
|
|
350
|
-
self.
|
|
337
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
351
338
|
**{
|
|
352
339
|
'direction': self._default_sg_rule.direction,
|
|
353
340
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -381,7 +368,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
381
368
|
|
|
382
369
|
columns, data = self.cmd.take_action(parsed_args)
|
|
383
370
|
|
|
384
|
-
self.
|
|
371
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
385
372
|
**{
|
|
386
373
|
'direction': self._default_sg_rule.direction,
|
|
387
374
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -415,7 +402,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
415
402
|
|
|
416
403
|
columns, data = self.cmd.take_action(parsed_args)
|
|
417
404
|
|
|
418
|
-
self.
|
|
405
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
419
406
|
**{
|
|
420
407
|
'direction': self._default_sg_rule.direction,
|
|
421
408
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -449,7 +436,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
449
436
|
|
|
450
437
|
columns, data = self.cmd.take_action(parsed_args)
|
|
451
438
|
|
|
452
|
-
self.
|
|
439
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
453
440
|
**{
|
|
454
441
|
'direction': self._default_sg_rule.direction,
|
|
455
442
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -599,7 +586,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
599
586
|
|
|
600
587
|
columns, data = self.cmd.take_action(parsed_args)
|
|
601
588
|
|
|
602
|
-
self.
|
|
589
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
603
590
|
**{
|
|
604
591
|
'direction': self._default_sg_rule.direction,
|
|
605
592
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -637,7 +624,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
637
624
|
|
|
638
625
|
columns, data = self.cmd.take_action(parsed_args)
|
|
639
626
|
|
|
640
|
-
self.
|
|
627
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
641
628
|
**{
|
|
642
629
|
'direction': self._default_sg_rule.direction,
|
|
643
630
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -675,7 +662,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
675
662
|
|
|
676
663
|
columns, data = self.cmd.take_action(parsed_args)
|
|
677
664
|
|
|
678
|
-
self.
|
|
665
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
679
666
|
**{
|
|
680
667
|
'direction': self._default_sg_rule.direction,
|
|
681
668
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -713,7 +700,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
713
700
|
|
|
714
701
|
columns, data = self.cmd.take_action(parsed_args)
|
|
715
702
|
|
|
716
|
-
self.
|
|
703
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
717
704
|
**{
|
|
718
705
|
'direction': self._default_sg_rule.direction,
|
|
719
706
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -754,7 +741,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
754
741
|
|
|
755
742
|
columns, data = self.cmd.take_action(parsed_args)
|
|
756
743
|
|
|
757
|
-
self.
|
|
744
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
758
745
|
**{
|
|
759
746
|
'direction': self._default_sg_rule.direction,
|
|
760
747
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -794,7 +781,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
794
781
|
|
|
795
782
|
columns, data = self.cmd.take_action(parsed_args)
|
|
796
783
|
|
|
797
|
-
self.
|
|
784
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
798
785
|
**{
|
|
799
786
|
'direction': self._default_sg_rule.direction,
|
|
800
787
|
'ethertype': self._default_sg_rule.ether_type,
|
|
@@ -825,7 +812,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
825
812
|
|
|
826
813
|
columns, data = self.cmd.take_action(parsed_args)
|
|
827
814
|
|
|
828
|
-
self.
|
|
815
|
+
self.network_client.create_default_security_group_rule.assert_called_once_with(
|
|
829
816
|
**{
|
|
830
817
|
'description': self._default_sg_rule.description,
|
|
831
818
|
'direction': self._default_sg_rule.direction,
|
|
@@ -840,7 +827,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
840
827
|
self.assertEqual(self.expected_data, data)
|
|
841
828
|
|
|
842
829
|
|
|
843
|
-
class TestDeleteDefaultSecurityGroupRule(
|
|
830
|
+
class TestDeleteDefaultSecurityGroupRule(network_fakes.TestNetworkV2):
|
|
844
831
|
# The default security group rules to be deleted.
|
|
845
832
|
default_security_group_rule_attrs = {
|
|
846
833
|
'direction': 'ingress',
|
|
@@ -866,7 +853,9 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
866
853
|
def setUp(self):
|
|
867
854
|
super().setUp()
|
|
868
855
|
|
|
869
|
-
self.
|
|
856
|
+
self.network_client.delete_default_security_group_rule.return_value = (
|
|
857
|
+
None
|
|
858
|
+
)
|
|
870
859
|
|
|
871
860
|
# Get the command object to test
|
|
872
861
|
self.cmd = default_security_group_rule.DeleteDefaultSecurityGroupRule(
|
|
@@ -880,7 +869,7 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
880
869
|
verifylist = [
|
|
881
870
|
('rule', [self._default_sg_rules[0].id]),
|
|
882
871
|
]
|
|
883
|
-
self.
|
|
872
|
+
self.network_client.find_default_security_group_rule.return_value = (
|
|
884
873
|
self._default_sg_rules[0]
|
|
885
874
|
)
|
|
886
875
|
|
|
@@ -888,7 +877,7 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
888
877
|
|
|
889
878
|
result = self.cmd.take_action(parsed_args)
|
|
890
879
|
|
|
891
|
-
self.
|
|
880
|
+
self.network_client.delete_default_security_group_rule.assert_called_once_with(
|
|
892
881
|
self._default_sg_rules[0]
|
|
893
882
|
)
|
|
894
883
|
self.assertIsNone(result)
|
|
@@ -902,7 +891,7 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
902
891
|
verifylist = [
|
|
903
892
|
('rule', arglist),
|
|
904
893
|
]
|
|
905
|
-
self.
|
|
894
|
+
self.network_client.find_default_security_group_rule.side_effect = (
|
|
906
895
|
self._default_sg_rules
|
|
907
896
|
)
|
|
908
897
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -912,7 +901,7 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
912
901
|
calls = []
|
|
913
902
|
for s in self._default_sg_rules:
|
|
914
903
|
calls.append(call(s))
|
|
915
|
-
self.
|
|
904
|
+
self.network_client.delete_default_security_group_rule.assert_has_calls(
|
|
916
905
|
calls
|
|
917
906
|
)
|
|
918
907
|
self.assertIsNone(result)
|
|
@@ -931,8 +920,8 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
931
920
|
self._default_sg_rules[0],
|
|
932
921
|
exceptions.CommandError,
|
|
933
922
|
]
|
|
934
|
-
self.
|
|
935
|
-
|
|
923
|
+
self.network_client.find_default_security_group_rule.side_effect = (
|
|
924
|
+
find_mock_result
|
|
936
925
|
)
|
|
937
926
|
|
|
938
927
|
try:
|
|
@@ -941,18 +930,18 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
941
930
|
except exceptions.CommandError as e:
|
|
942
931
|
self.assertEqual('1 of 2 default rules failed to delete.', str(e))
|
|
943
932
|
|
|
944
|
-
self.
|
|
933
|
+
self.network_client.find_default_security_group_rule.assert_any_call(
|
|
945
934
|
self._default_sg_rules[0].id, ignore_missing=False
|
|
946
935
|
)
|
|
947
|
-
self.
|
|
936
|
+
self.network_client.find_default_security_group_rule.assert_any_call(
|
|
948
937
|
'unexist_rule', ignore_missing=False
|
|
949
938
|
)
|
|
950
|
-
self.
|
|
939
|
+
self.network_client.delete_default_security_group_rule.assert_called_once_with(
|
|
951
940
|
self._default_sg_rules[0]
|
|
952
941
|
)
|
|
953
942
|
|
|
954
943
|
|
|
955
|
-
class TestListDefaultSecurityGroupRule(
|
|
944
|
+
class TestListDefaultSecurityGroupRule(network_fakes.TestNetworkV2):
|
|
956
945
|
# The security group rule to be listed.
|
|
957
946
|
_default_sg_rule_tcp = sdk_fakes.generate_fake_resource(
|
|
958
947
|
_default_security_group_rule.DefaultSecurityGroupRule,
|
|
@@ -1001,7 +990,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1001
990
|
def setUp(self):
|
|
1002
991
|
super().setUp()
|
|
1003
992
|
|
|
1004
|
-
self.
|
|
993
|
+
self.network_client.default_security_group_rules.return_value = (
|
|
1005
994
|
self._default_sg_rules
|
|
1006
995
|
)
|
|
1007
996
|
|
|
@@ -1016,7 +1005,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1016
1005
|
|
|
1017
1006
|
columns, data = self.cmd.take_action(parsed_args)
|
|
1018
1007
|
|
|
1019
|
-
self.
|
|
1008
|
+
self.network_client.default_security_group_rules.assert_called_once_with(
|
|
1020
1009
|
**{}
|
|
1021
1010
|
)
|
|
1022
1011
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -1035,7 +1024,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1035
1024
|
|
|
1036
1025
|
columns, data = self.cmd.take_action(parsed_args)
|
|
1037
1026
|
|
|
1038
|
-
self.
|
|
1027
|
+
self.network_client.default_security_group_rules.assert_called_once_with(
|
|
1039
1028
|
**{
|
|
1040
1029
|
'protocol': 'tcp',
|
|
1041
1030
|
}
|
|
@@ -1055,7 +1044,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1055
1044
|
|
|
1056
1045
|
columns, data = self.cmd.take_action(parsed_args)
|
|
1057
1046
|
|
|
1058
|
-
self.
|
|
1047
|
+
self.network_client.default_security_group_rules.assert_called_once_with(
|
|
1059
1048
|
**{
|
|
1060
1049
|
'direction': 'ingress',
|
|
1061
1050
|
}
|
|
@@ -1075,7 +1064,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1075
1064
|
|
|
1076
1065
|
columns, data = self.cmd.take_action(parsed_args)
|
|
1077
1066
|
|
|
1078
|
-
self.
|
|
1067
|
+
self.network_client.default_security_group_rules.assert_called_once_with(
|
|
1079
1068
|
**{
|
|
1080
1069
|
'direction': 'egress',
|
|
1081
1070
|
}
|
|
@@ -1084,7 +1073,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1084
1073
|
self.assertEqual(self.expected_data, list(data))
|
|
1085
1074
|
|
|
1086
1075
|
|
|
1087
|
-
class TestShowDefaultSecurityGroupRule(
|
|
1076
|
+
class TestShowDefaultSecurityGroupRule(network_fakes.TestNetworkV2):
|
|
1088
1077
|
# The default security group rule to be shown.
|
|
1089
1078
|
_default_sg_rule = sdk_fakes.generate_fake_resource(
|
|
1090
1079
|
_default_security_group_rule.DefaultSecurityGroupRule
|
|
@@ -1123,7 +1112,7 @@ class TestShowDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1123
1112
|
def setUp(self):
|
|
1124
1113
|
super().setUp()
|
|
1125
1114
|
|
|
1126
|
-
self.
|
|
1115
|
+
self.network_client.find_default_security_group_rule.return_value = (
|
|
1127
1116
|
self._default_sg_rule
|
|
1128
1117
|
)
|
|
1129
1118
|
|
|
@@ -1148,7 +1137,7 @@ class TestShowDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1148
1137
|
|
|
1149
1138
|
columns, data = self.cmd.take_action(parsed_args)
|
|
1150
1139
|
|
|
1151
|
-
self.
|
|
1140
|
+
self.network_client.find_default_security_group_rule.assert_called_once_with(
|
|
1152
1141
|
self._default_sg_rule.id, ignore_missing=False
|
|
1153
1142
|
)
|
|
1154
1143
|
self.assertEqual(self.columns, columns)
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
#
|
|
13
13
|
|
|
14
|
-
from unittest import mock
|
|
15
14
|
from unittest.mock import call
|
|
16
15
|
|
|
17
16
|
from openstack.network.v2 import floating_ip as _floating_ip
|
|
@@ -86,16 +85,14 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
86
85
|
def setUp(self):
|
|
87
86
|
super().setUp()
|
|
88
87
|
|
|
89
|
-
self.network_client.create_ip =
|
|
90
|
-
return_value=self.floating_ip
|
|
91
|
-
)
|
|
92
|
-
self.network_client.set_tags = mock.Mock(return_value=None)
|
|
88
|
+
self.network_client.create_ip.return_value = self.floating_ip
|
|
93
89
|
|
|
94
|
-
self.network_client.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
self.network_client.
|
|
90
|
+
self.network_client.set_tags.return_value = None
|
|
91
|
+
|
|
92
|
+
self.network_client.find_network.return_value = self.floating_network
|
|
93
|
+
|
|
94
|
+
self.network_client.find_subnet.return_value = self.subnet
|
|
95
|
+
self.network_client.find_port.return_value = self.port
|
|
99
96
|
|
|
100
97
|
# Get the command object to test
|
|
101
98
|
self.cmd = fip.CreateFloatingIP(self.app, None)
|
|
@@ -304,7 +301,7 @@ class TestDeleteFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
304
301
|
def setUp(self):
|
|
305
302
|
super().setUp()
|
|
306
303
|
|
|
307
|
-
self.network_client.delete_ip =
|
|
304
|
+
self.network_client.delete_ip.return_value = None
|
|
308
305
|
|
|
309
306
|
# Get the command object to test
|
|
310
307
|
self.cmd = fip.DeleteFloatingIP(self.app, None)
|
|
@@ -470,14 +467,11 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
470
467
|
def setUp(self):
|
|
471
468
|
super().setUp()
|
|
472
469
|
|
|
473
|
-
self.network_client.ips =
|
|
474
|
-
self.network_client.find_network =
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
self.network_client.
|
|
478
|
-
self.network_client.find_router = mock.Mock(
|
|
479
|
-
return_value=self.fake_router
|
|
480
|
-
)
|
|
470
|
+
self.network_client.ips.return_value = self.floating_ips
|
|
471
|
+
self.network_client.find_network.return_value = self.fake_network
|
|
472
|
+
|
|
473
|
+
self.network_client.find_port.return_value = self.fake_port
|
|
474
|
+
self.network_client.find_router.return_value = self.fake_router
|
|
481
475
|
|
|
482
476
|
# Get the command object to test
|
|
483
477
|
self.cmd = fip.ListFloatingIP(self.app, None)
|
|
@@ -713,7 +707,7 @@ class TestShowFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
713
707
|
self.floating_ip = sdk_fakes.generate_fake_resource(
|
|
714
708
|
_floating_ip.FloatingIP
|
|
715
709
|
)
|
|
716
|
-
self.network_client.find_ip =
|
|
710
|
+
self.network_client.find_ip.return_value = self.floating_ip
|
|
717
711
|
|
|
718
712
|
self.columns = (
|
|
719
713
|
'created_at',
|
|
@@ -797,10 +791,10 @@ class TestSetFloatingIP(TestFloatingIPNetwork):
|
|
|
797
791
|
|
|
798
792
|
def setUp(self):
|
|
799
793
|
super().setUp()
|
|
800
|
-
self.network_client.find_ip =
|
|
801
|
-
self.network_client.find_port =
|
|
802
|
-
self.network_client.update_ip =
|
|
803
|
-
self.network_client.set_tags =
|
|
794
|
+
self.network_client.find_ip.return_value = self.floating_ip
|
|
795
|
+
self.network_client.find_port.return_value = self.port
|
|
796
|
+
self.network_client.update_ip.return_value = None
|
|
797
|
+
self.network_client.set_tags.return_value = None
|
|
804
798
|
|
|
805
799
|
# Get the command object to test
|
|
806
800
|
self.cmd = fip.SetFloatingIP(self.app, None)
|
|
@@ -1044,9 +1038,9 @@ class TestUnsetFloatingIP(TestFloatingIPNetwork):
|
|
|
1044
1038
|
|
|
1045
1039
|
def setUp(self):
|
|
1046
1040
|
super().setUp()
|
|
1047
|
-
self.network_client.find_ip =
|
|
1048
|
-
self.network_client.update_ip =
|
|
1049
|
-
self.network_client.set_tags =
|
|
1041
|
+
self.network_client.find_ip.return_value = self.floating_ip
|
|
1042
|
+
self.network_client.update_ip.return_value = None
|
|
1043
|
+
self.network_client.set_tags.return_value = None
|
|
1050
1044
|
|
|
1051
1045
|
# Get the command object to test
|
|
1052
1046
|
self.cmd = fip.UnsetFloatingIP(self.app, None)
|
|
@@ -33,7 +33,7 @@ class TestFloatingIPPortForwarding(network_fakes.TestNetworkV2):
|
|
|
33
33
|
)
|
|
34
34
|
self.port = network_fakes.create_one_port()
|
|
35
35
|
self.project = identity_fakes_v2.FakeProject.create_one_project()
|
|
36
|
-
self.network_client.find_port =
|
|
36
|
+
self.network_client.find_port.return_value = self.port
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class TestCreateFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
@@ -54,11 +54,11 @@ class TestCreateFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
54
54
|
},
|
|
55
55
|
)
|
|
56
56
|
|
|
57
|
-
self.network_client.create_floating_ip_port_forwarding =
|
|
58
|
-
|
|
57
|
+
self.network_client.create_floating_ip_port_forwarding.return_value = (
|
|
58
|
+
self.new_port_forwarding
|
|
59
59
|
)
|
|
60
60
|
|
|
61
|
-
self.network_client.find_ip =
|
|
61
|
+
self.network_client.find_ip.return_value = self.floating_ip
|
|
62
62
|
|
|
63
63
|
# Get the command object to test
|
|
64
64
|
self.cmd = floating_ip_port_forwarding.CreateFloatingIPPortForwarding(
|
|
@@ -351,11 +351,11 @@ class TestDeleteFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
351
351
|
},
|
|
352
352
|
)
|
|
353
353
|
)
|
|
354
|
-
self.network_client.delete_floating_ip_port_forwarding =
|
|
355
|
-
|
|
354
|
+
self.network_client.delete_floating_ip_port_forwarding.return_value = (
|
|
355
|
+
None
|
|
356
356
|
)
|
|
357
357
|
|
|
358
|
-
self.network_client.find_ip =
|
|
358
|
+
self.network_client.find_ip.return_value = self.floating_ip
|
|
359
359
|
# Get the command object to test
|
|
360
360
|
self.cmd = floating_ip_port_forwarding.DeleteFloatingIPPortForwarding(
|
|
361
361
|
self.app, None
|
|
@@ -490,10 +490,11 @@ class TestListFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
490
490
|
port_forwarding.description,
|
|
491
491
|
)
|
|
492
492
|
)
|
|
493
|
-
self.network_client.floating_ip_port_forwardings =
|
|
494
|
-
|
|
493
|
+
self.network_client.floating_ip_port_forwardings.return_value = (
|
|
494
|
+
self.port_forwardings
|
|
495
495
|
)
|
|
496
|
-
|
|
496
|
+
|
|
497
|
+
self.network_client.find_ip.return_value = self.floating_ip
|
|
497
498
|
# Get the command object to test
|
|
498
499
|
self.cmd = floating_ip_port_forwarding.ListFloatingIPPortForwarding(
|
|
499
500
|
self.app, None
|
|
@@ -557,14 +558,15 @@ class TestSetFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
557
558
|
'floatingip_id': self.floating_ip.id,
|
|
558
559
|
}
|
|
559
560
|
)
|
|
560
|
-
self.network_client.update_floating_ip_port_forwarding =
|
|
561
|
-
|
|
561
|
+
self.network_client.update_floating_ip_port_forwarding.return_value = (
|
|
562
|
+
None
|
|
562
563
|
)
|
|
563
564
|
|
|
564
|
-
self.network_client.find_floating_ip_port_forwarding =
|
|
565
|
-
|
|
565
|
+
self.network_client.find_floating_ip_port_forwarding.return_value = (
|
|
566
|
+
self._port_forwarding
|
|
566
567
|
)
|
|
567
|
-
|
|
568
|
+
|
|
569
|
+
self.network_client.find_ip.return_value = self.floating_ip
|
|
568
570
|
# Get the command object to test
|
|
569
571
|
self.cmd = floating_ip_port_forwarding.SetFloatingIPPortForwarding(
|
|
570
572
|
self.app, None
|
|
@@ -690,10 +692,11 @@ class TestShowFloatingIPPortForwarding(TestFloatingIPPortForwarding):
|
|
|
690
692
|
self._port_forwarding.internal_port_range,
|
|
691
693
|
self._port_forwarding.protocol,
|
|
692
694
|
)
|
|
693
|
-
self.network_client.find_floating_ip_port_forwarding =
|
|
694
|
-
|
|
695
|
+
self.network_client.find_floating_ip_port_forwarding.return_value = (
|
|
696
|
+
self._port_forwarding
|
|
695
697
|
)
|
|
696
|
-
|
|
698
|
+
|
|
699
|
+
self.network_client.find_ip.return_value = self.floating_ip
|
|
697
700
|
# Get the command object to test
|
|
698
701
|
self.cmd = floating_ip_port_forwarding.ShowFloatingIPPortForwarding(
|
|
699
702
|
self.app, None
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
#
|
|
13
13
|
|
|
14
|
-
from unittest import mock
|
|
15
14
|
|
|
16
15
|
from osc_lib.cli import format_columns
|
|
17
16
|
|
|
@@ -55,8 +54,8 @@ class TestListIPAvailability(TestIPAvailability):
|
|
|
55
54
|
super().setUp()
|
|
56
55
|
|
|
57
56
|
self.cmd = ip_availability.ListIPAvailability(self.app, None)
|
|
58
|
-
self.network_client.network_ip_availabilities =
|
|
59
|
-
|
|
57
|
+
self.network_client.network_ip_availabilities.return_value = (
|
|
58
|
+
self._ip_availability
|
|
60
59
|
)
|
|
61
60
|
|
|
62
61
|
def test_list_no_options(self):
|
|
@@ -134,13 +133,12 @@ class TestShowIPAvailability(TestIPAvailability):
|
|
|
134
133
|
def setUp(self):
|
|
135
134
|
super().setUp()
|
|
136
135
|
|
|
137
|
-
self.network_client.find_network_ip_availability =
|
|
138
|
-
|
|
139
|
-
)
|
|
140
|
-
self.network_client.find_network = mock.Mock(
|
|
141
|
-
return_value=self._network
|
|
136
|
+
self.network_client.find_network_ip_availability.return_value = (
|
|
137
|
+
self._ip_availability
|
|
142
138
|
)
|
|
143
139
|
|
|
140
|
+
self.network_client.find_network.return_value = self._network
|
|
141
|
+
|
|
144
142
|
# Get the command object to test
|
|
145
143
|
self.cmd = ip_availability.ShowIPAvailability(self.app, None)
|
|
146
144
|
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
#
|
|
13
13
|
|
|
14
|
-
from unittest import mock
|
|
15
14
|
|
|
16
15
|
from osc_lib import exceptions
|
|
17
16
|
|
|
@@ -46,8 +45,8 @@ class TestCreateL3ConntrackHelper(TestConntrackHelper):
|
|
|
46
45
|
self.ct_helper.protocol,
|
|
47
46
|
self.ct_helper.router_id,
|
|
48
47
|
)
|
|
49
|
-
self.network_client.create_conntrack_helper =
|
|
50
|
-
|
|
48
|
+
self.network_client.create_conntrack_helper.return_value = (
|
|
49
|
+
self.ct_helper
|
|
51
50
|
)
|
|
52
51
|
|
|
53
52
|
# Get the command object to test
|
|
@@ -119,9 +118,7 @@ class TestDeleteL3ConntrackHelper(TestConntrackHelper):
|
|
|
119
118
|
attrs
|
|
120
119
|
)
|
|
121
120
|
)
|
|
122
|
-
self.network_client.delete_conntrack_helper =
|
|
123
|
-
return_value=None
|
|
124
|
-
)
|
|
121
|
+
self.network_client.delete_conntrack_helper.return_value = None
|
|
125
122
|
|
|
126
123
|
# Get the command object to test
|
|
127
124
|
self.cmd = l3_conntrack_helper.DeleteConntrackHelper(self.app, None)
|
|
@@ -181,9 +178,7 @@ class TestListL3ConntrackHelper(TestConntrackHelper):
|
|
|
181
178
|
ct_helper.port,
|
|
182
179
|
)
|
|
183
180
|
)
|
|
184
|
-
self.network_client.conntrack_helpers =
|
|
185
|
-
return_value=ct_helpers
|
|
186
|
-
)
|
|
181
|
+
self.network_client.conntrack_helpers.return_value = ct_helpers
|
|
187
182
|
|
|
188
183
|
# Get the command object to test
|
|
189
184
|
self.cmd = l3_conntrack_helper.ListConntrackHelper(self.app, None)
|
|
@@ -216,9 +211,7 @@ class TestSetL3ConntrackHelper(TestConntrackHelper):
|
|
|
216
211
|
attrs
|
|
217
212
|
)
|
|
218
213
|
)
|
|
219
|
-
self.network_client.update_conntrack_helper =
|
|
220
|
-
return_value=None
|
|
221
|
-
)
|
|
214
|
+
self.network_client.update_conntrack_helper.return_value = None
|
|
222
215
|
|
|
223
216
|
# Get the command object to test
|
|
224
217
|
self.cmd = l3_conntrack_helper.SetConntrackHelper(self.app, None)
|
|
@@ -281,9 +274,7 @@ class TestShowL3ConntrackHelper(TestConntrackHelper):
|
|
|
281
274
|
self.ct_helper.protocol,
|
|
282
275
|
self.ct_helper.router_id,
|
|
283
276
|
)
|
|
284
|
-
self.network_client.get_conntrack_helper =
|
|
285
|
-
return_value=self.ct_helper
|
|
286
|
-
)
|
|
277
|
+
self.network_client.get_conntrack_helper.return_value = self.ct_helper
|
|
287
278
|
|
|
288
279
|
# Get the command object to test
|
|
289
280
|
self.cmd = l3_conntrack_helper.ShowConntrackHelper(self.app, None)
|