code
stringlengths
3
6.57k
_get_path('networks', id=_uuid()
_uuid()
_get_path('networks', id=_uuid()
join([resource, opname, "start"])
join([resource, opname, "end"])
self.assertEqual(len(expected_events)
len(fake_notifier.NOTIFICATIONS)
zip(fake_notifier.NOTIFICATIONS, expected_events)
self.assertEqual('INFO', msg['priority'])
self.assertEqual(event, msg['event_type'])
self.assertIn('payload', msg)
self.assertIn('network_id', resource)
self.assertIn('network', resource)
self.assertEqual(expected_code, res.status_int)
test_network_create_notifer(self)
self._resource_op_notifier('create', 'network')
test_network_delete_notifer(self)
self._resource_op_notifier('delete', 'network')
test_network_update_notifer(self)
self._resource_op_notifier('update', 'network')
RegistryNotificationTest(APIv2TestBase)
setUp(self)
cfg.CONF.set_override('track_quota_usage', False, group='QUOTAS')
super(RegistryNotificationTest, self)
setUp()
_test_registry_notify(self, opname, resource, initial_input=None)
mock.patch.object(registry, 'publish')
_get_path('networks')
_get_path('networks', id=_uuid()
self.api.delete(_get_path('networks', id=_uuid()
self.assertTrue(notify.called)
self.assertEqual(expected_code, res.status_int)
test_network_create_registry_notify(self)
_uuid()
self._test_registry_notify('create', 'network', input)
test_network_delete_registry_notify(self)
self._test_registry_notify('delete', 'network')
test_network_update_registry_notify(self)
self._test_registry_notify('update', 'network', input)
test_networks_create_bulk_registry_notify(self)
_uuid()
_uuid()
self._test_registry_notify('create', 'network', input)
QuotaTest(APIv2TestBase)
setUp(self)
cfg.CONF.set_override('track_quota_usage', False, group='QUOTAS')
super(QuotaTest, self)
setUp()
resource_registry.ResourceRegistry()
registry_patcher.start()
replacement_registry.register_resource_by_name('network')
test_create_network_quota(self)
cfg.CONF.set_override('quota_network', 1, group='QUOTAS')
_uuid()
update(initial_input['network'])
_get_path('networks')
test_create_network_quota_no_counts(self)
cfg.CONF.set_override('quota_network', 1, group='QUOTAS')
_uuid()
update(initial_input['network'])
NotImplementedError()
_get_path('networks')
test_create_network_quota_without_limit(self)
cfg.CONF.set_override('quota_network', -1, group='QUOTAS')
_uuid()
_get_path('networks')
self.assertEqual(exc.HTTPCreated.code, res.status_int)
ExtensionTestCase(base.BaseTestCase)
setUp(self)
cfg.CONF.set_override('track_quota_usage', False, group='QUOTAS')
super(ExtensionTestCase, self)
setUp()
self.useFixture(fixture.APIDefinitionFixture()
self.config_parse()
self.setup_coreplugin(plugin, load_plugins=False)
cfg.CONF.set_override('api_extensions_path', EXTDIR)
mock.patch(plugin, autospec=True)
self._plugin_patcher.start()
router.APIRouter()
webtest.TestApp(api)
test_extended_create(self)
_uuid()
_uuid()
update(initial_input['network'])
return_value.update(data['network'].copy()
self.api.post_json(_get_path('networks')
self.assertEqual(exc.HTTPCreated.code, res.status_int)
self.assertIn('network', res.json)
self.assertEqual(net_id, net['id'])
self.assertEqual("ACTIVE", net['status'])
self.assertEqual("123", net['v2attrs:something'])
self.assertNotIn('v2attrs:something_else', net)
TestSubresourcePlugin(object)
create_network_dummy(self, context, network_id, dummy)
update_network_dummy(self, context, id, network_id, dummy)
delete_network_dummy(self, context, id, network_id)
mactions(self, context, id, network_id)
ListArgsTestCase(base.BaseTestCase)
test_list_args(self)
webob.Request.blank(path)