diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-03-24 19:22:07 +0800 |
|---|---|---|
| committer | Tang Chen <chen.tang@easystack.cn> | 2016-04-09 16:25:50 +0800 |
| commit | b3649a54cd59dc069c76cbbcd876a1610aee00c0 (patch) | |
| tree | 7bba85fc7df7e0242b117892e885f18d8fcefaf7 /openstackclient/tests/network/v2/fakes.py | |
| parent | 6c739466239d6a6565498e5a7bdc25706e91329b (diff) | |
| download | python-openstackclient-b3649a54cd59dc069c76cbbcd876a1610aee00c0.tar.gz | |
Add --address-scope option "subnet pool create/set"
This patch adds --address-scope option to "subnet pool create/set"
commands, and --no-address-scope option to "subnet pool set"
command to clear the address scope setting.
Change-Id: Ie2c370a50b52574fa6ec268083ad013b7544361e
Partial-Bug: #1544586
Partial-Bug: #1544591
Diffstat (limited to 'openstackclient/tests/network/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/network/v2/fakes.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index 7f89ef7a..409b18f2 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -71,6 +71,43 @@ class TestNetworkV2(utils.TestCommand): ) +class FakeAddressScope(object): + """Fake one or more address scopes.""" + + @staticmethod + def create_one_address_scope(attrs=None): + """Create a fake address scope. + + :param Dictionary attrs: + A dictionary with all attributes + :return: + A FakeResource object with name, id, etc. + """ + if attrs is None: + attrs = {} + + # Set default attributes. + address_scope_attrs = { + 'name': 'address-scope-name-' + uuid.uuid4().hex, + 'id': 'address-scope-id-' + uuid.uuid4().hex, + 'tenant_id': 'project-id-' + uuid.uuid4().hex, + 'shared': False, + 'ip_version': 4, + } + + # Overwrite default attributes. + address_scope_attrs.update(attrs) + + address_scope = fakes.FakeResource( + info=copy.deepcopy(address_scope_attrs), + loaded=True) + + # Set attributes with special mapping in OpenStack SDK. + address_scope.project_id = address_scope_attrs['tenant_id'] + + return address_scope + + class FakeAvailabilityZone(object): """Fake one or more network availability zones (AZs).""" |
