def test_resource_negative_default_value(self): res = resource.BaseResource('foo', 'foo_quota') with mock.patch('oslo_config.cfg.CONF') as mock_cfg: mock_cfg.QUOTAS.foo_quota = -99 self.assertEqual(-1, res.default)
def test_create_resource_without_plural_name(self): res = resource.BaseResource('foo', None) self.assertEqual('foos', res.plural_name) res = resource.BaseResource('foy', None) self.assertEqual('foies', res.plural_name)
def test_create_resource_with_plural_name(self): res = resource.BaseResource('foo', None, plural_name='foopsies') self.assertEqual('foopsies', res.plural_name)
from quark.plugin_modules import jobs from quark.plugin_modules import mac_address_ranges from quark.plugin_modules import networks from quark.plugin_modules import ports from quark.plugin_modules import router from quark.plugin_modules import routes from quark.plugin_modules import security_groups from quark.plugin_modules import segment_allocation_ranges from quark.plugin_modules import subnets LOG = logging.getLogger(__name__) CONF = cfg.CONF quark_resources = [ qres.BaseResource('alloc_pools_per_subnet', 'quota_alloc_pools_per_subnet'), qres.BaseResource('dns_nameservers_per_subnet', 'quota_dns_nameservers_per_subnet'), qres.BaseResource('ports_per_network', 'quota_ports_per_network'), qres.BaseResource('routes_per_subnet', 'quota_routes_per_subnet'), qres.BaseResource('security_rules_per_group', 'quota_security_rules_per_group'), qres.BaseResource('security_groups_per_port', 'quota_security_groups_per_port'), qres.BaseResource('v4_subnets_per_network', 'quota_v4_subnets_per_network'), qres.BaseResource('v6_subnets_per_network', 'quota_v6_subnets_per_network'), qres.BaseResource('fixed_ips_per_port', 'quota_fixed_ips_per_port') ]