diff options
| author | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-05-28 12:50:14 +0800 |
|---|---|---|
| committer | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-05-28 13:46:38 +0800 |
| commit | 537f5cbe8ac9439351afe365360eeb38fb340fcb (patch) | |
| tree | 3e33692d5318524708ad3bd18991f73f0fbce880 /openstackclient/tests/network/v2/fakes.py | |
| parent | 9da02d14eadc39da6f97b3df095af8b0c452a5b4 (diff) | |
| download | python-openstackclient-537f5cbe8ac9439351afe365360eeb38fb340fcb.tar.gz | |
Support deleting multi address scopes in networkv2
This patch adds support for deleting multi address scopes by
using "address scope delete" command.
Change-Id: Ic8d3ebc17db44ca5d42c336d2c4d5633f70d4e8b
Partially-Implements: blueprint multi-argument-network
Diffstat (limited to 'openstackclient/tests/network/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/network/v2/fakes.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index 417cf26e..ce6f63e8 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -127,6 +127,25 @@ class FakeAddressScope(object): return address_scopes + @staticmethod + def get_address_scopes(address_scopes=None, count=2): + """Get an iterable MagicMock object with a list of faked address scopes. + + If address scopes list is provided, then initialize the Mock object + with the list. Otherwise create one. + + :param List address scopes: + A list of FakeResource objects faking address scopes + :param int count: + The number of address scopes to fake + :return: + An iterable Mock object with side_effect set to a list of faked + address scopes + """ + if address_scopes is None: + address_scopes = FakeAddressScope.create_address_scopes(count) + return mock.MagicMock(side_effect=address_scopes) + class FakeAvailabilityZone(object): """Fake one or more network availability zones (AZs).""" |
