Skip to content

Commit 8031cd2

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Replace 'MagicMock' with 'Mock'"
2 parents 15069ef + 3e97491 commit 8031cd2

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

openstackclient/tests/unit/network/v2/fakes.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def create_address_scopes(attrs=None, count=2):
122122

123123
@staticmethod
124124
def get_address_scopes(address_scopes=None, count=2):
125-
"""Get an iterable MagicMock object with a list of faked address scopes.
125+
"""Get an iterable Mock object with a list of faked address scopes.
126126
127127
If address scopes list is provided, then initialize the Mock object
128128
with the list. Otherwise create one.
@@ -331,7 +331,7 @@ def create_networks(attrs=None, count=2):
331331

332332
@staticmethod
333333
def get_networks(networks=None, count=2):
334-
"""Get an iterable MagicMock object with a list of faked networks.
334+
"""Get an iterable Mock object with a list of faked networks.
335335
336336
If networks list is provided, then initialize the Mock object with the
337337
list. Otherwise create one.
@@ -478,7 +478,7 @@ def create_ports(attrs=None, count=2):
478478

479479
@staticmethod
480480
def get_ports(ports=None, count=2):
481-
"""Get an iterable MagicMock object with a list of faked ports.
481+
"""Get an iterable Mock object with a list of faked ports.
482482
483483
If ports list is provided, then initialize the Mock object with the
484484
list. Otherwise create one.
@@ -545,7 +545,7 @@ def create_network_agents(attrs=None, count=2):
545545

546546
@staticmethod
547547
def get_network_agents(agents=None, count=2):
548-
"""Get an iterable MagicMock object with a list of faked network agents.
548+
"""Get an iterable Mock object with a list of faked network agents.
549549
550550
If network agents list is provided, then initialize the Mock object
551551
with the list. Otherwise create one.
@@ -615,7 +615,7 @@ def create_network_rbacs(attrs=None, count=2):
615615

616616
@staticmethod
617617
def get_network_rbacs(rbac_policies=None, count=2):
618-
"""Get an iterable MagicMock object with a list of faked rbac policies.
618+
"""Get an iterable Mock object with a list of faked rbac policies.
619619
620620
If rbac policies list is provided, then initialize the Mock object
621621
with the list. Otherwise create one.
@@ -694,7 +694,7 @@ def create_routers(attrs=None, count=2):
694694

695695
@staticmethod
696696
def get_routers(routers=None, count=2):
697-
"""Get an iterable MagicMock object with a list of faked routers.
697+
"""Get an iterable Mock object with a list of faked routers.
698698
699699
If routers list is provided, then initialize the Mock object with the
700700
list. Otherwise create one.
@@ -767,7 +767,7 @@ def create_security_groups(attrs=None, count=2):
767767

768768
@staticmethod
769769
def get_security_groups(security_groups=None, count=2):
770-
"""Get an iterable MagicMock object with a list of faked security groups.
770+
"""Get an iterable Mock object with a list of faked security groups.
771771
772772
If security groups list is provided, then initialize the Mock object
773773
with the list. Otherwise create one.
@@ -845,7 +845,7 @@ def create_security_group_rules(attrs=None, count=2):
845845

846846
@staticmethod
847847
def get_security_group_rules(security_group_rules=None, count=2):
848-
"""Get an iterable MagicMock object with a list of faked security group rules.
848+
"""Get an iterable Mock object with a list of faked security group rules.
849849
850850
If security group rules list is provided, then initialize the Mock
851851
object with the list. Otherwise create one.
@@ -930,7 +930,7 @@ def create_subnets(attrs=None, count=2):
930930

931931
@staticmethod
932932
def get_subnets(subnets=None, count=2):
933-
"""Get an iterable MagicMock object with a list of faked subnets.
933+
"""Get an iterable Mock object with a list of faked subnets.
934934
935935
If subnets list is provided, then initialize the Mock object
936936
with the list. Otherwise create one.
@@ -1008,7 +1008,7 @@ def create_floating_ips(attrs=None, count=2):
10081008

10091009
@staticmethod
10101010
def get_floating_ips(floating_ips=None, count=2):
1011-
"""Get an iterable MagicMock object with a list of faked floating ips.
1011+
"""Get an iterable Mock object with a list of faked floating ips.
10121012
10131013
If floating_ips list is provided, then initialize the Mock object
10141014
with the list. Otherwise create one.
@@ -1091,7 +1091,7 @@ def create_subnet_pools(attrs=None, count=2):
10911091

10921092
@staticmethod
10931093
def get_subnet_pools(subnet_pools=None, count=2):
1094-
"""Get an iterable MagicMock object with a list of faked subnet pools.
1094+
"""Get an iterable Mock object with a list of faked subnet pools.
10951095
10961096
If subnet_pools list is provided, then initialize the Mock object
10971097
with the list. Otherwise create one.

openstackclient/tests/unit/network/v2/test_network_segment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def setUp(self):
163163
super(TestDeleteNetworkSegment, self).setUp()
164164

165165
self.network.delete_segment = mock.Mock(return_value=None)
166-
self.network.find_segment = mock.MagicMock(
166+
self.network.find_segment = mock.Mock(
167167
side_effect=self._network_segments
168168
)
169169

@@ -220,7 +220,7 @@ def test_delete_multiple_with_exception(self):
220220
find_mock_result = [self._network_segments[0],
221221
exceptions.CommandError]
222222
self.network.find_segment = (
223-
mock.MagicMock(side_effect=find_mock_result)
223+
mock.Mock(side_effect=find_mock_result)
224224
)
225225

226226
try:

0 commit comments

Comments
 (0)