neutron/neutron/tests/unit/quota
Ihar Hrachyshka 8a0faef877 TestTrackedResource: register core plugin in directory
This is achieved by switching the test class to BaseTestCase and using
setup_coreplugin. This makes later calls to neutron.objects.db.api
functions that extract the plugin from plugins directory to work.

The test class registers some sqlalchemy events for models not
registered in BASEV2, which later makes unregister_events fail because
of failure to compare those model classes with other registered model
classes (those that belong to proper model classes like Port). Before
the patch, the core plugin was not correctly registered in plugins
directory, and no code was actually loading the plugin, so no other
sqla events were in _REGISTERED_SQLA_EVENTS, which explains why
previously calls to unregister_events hasn't failed.

Good news is that the new parent class does clean up all events itself,
so we don't need to set the cleanup hook ourselves.

This switch also facilitated removal of some other preparatory steps
from the class that are already implemented in the new parent.

Closes-Bug: #1677636
Change-Id: Id462e532066ac3cd5e2f76c3670da7f7820c6581
2017-03-30 18:05:33 +00:00
..
__init__.py Switch to neutron-lib for model_base 2016-08-31 11:12:18 -04:00
test_resource.py TestTrackedResource: register core plugin in directory 2017-03-30 18:05:33 +00:00
test_resource_registry.py Spin off context module 2017-03-06 16:25:29 +00:00