8a0faef877
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 |
||
---|---|---|
.. | ||
__init__.py | ||
test_resource.py | ||
test_resource_registry.py |