From 58591d3c37c0265d8775f881271ba4d987e5ffb6 Mon Sep 17 00:00:00 2001 From: Sindhu Devale Date: Thu, 29 Sep 2016 15:32:51 -0500 Subject: OSC Quota List Implement Neutron feature of Quota List into OpenStack Client. Change-Id: Idf941acf8d00b136776b7381b877c56d82622f57 Partially-Implements: blueprint neutron-client-quota --- openstackclient/tests/unit/network/v2/fakes.py | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'openstackclient/tests/unit/network') diff --git a/openstackclient/tests/unit/network/v2/fakes.py b/openstackclient/tests/unit/network/v2/fakes.py index dcecbeee..d8756688 100644 --- a/openstackclient/tests/unit/network/v2/fakes.py +++ b/openstackclient/tests/unit/network/v2/fakes.py @@ -1494,3 +1494,53 @@ class FakeNetworkServiceProvider(object): create_one_network_service_provider( attrs)) return service_providers + + +class FakeQuota(object): + """Fake quota""" + + @staticmethod + def create_one_net_quota(attrs=None): + """Create one quota""" + attrs = attrs or {} + + quota_attrs = { + 'floating_ips': 20, + 'networks': 25, + 'ports': 11, + 'rbac_policies': 15, + 'routers': 40, + 'security_groups': 10, + 'security_group_rules': 100, + 'subnets': 20, + 'subnet_pools': 30} + + quota_attrs.update(attrs) + + quota = fakes.FakeResource( + info=copy.deepcopy(quota_attrs), + loaded=True) + return quota + + @staticmethod + def create_one_default_net_quota(attrs=None): + """Create one quota""" + attrs = attrs or {} + + quota_attrs = { + 'floatingip': 30, + 'network': 20, + 'port': 10, + 'rbac_policy': 25, + 'router': 30, + 'security_group': 30, + 'security_group_rule': 200, + 'subnet': 10, + 'subnetpool': 20} + + quota_attrs.update(attrs) + + quota = fakes.FakeResource( + info=copy.deepcopy(quota_attrs), + loaded=True) + return quota -- cgit v1.2.1