]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
tests: initialize admin context after super().setUp call
authorIhar Hrachyshka <ihrachys@redhat.com>
Mon, 8 Dec 2014 12:51:02 +0000 (13:51 +0100)
committerIhar Hrachyshka <ihrachys@redhat.com>
Mon, 15 Dec 2014 11:09:55 +0000 (12:09 +0100)
commite33349e216e9361f4d93e012b91dd69b4bea9e92
treebabaad5f8158ec2ee95ea7dece0b576547027d7a
parentb4a0fa3c34cd193c953557cc0931681ff0582768
tests: initialize admin context after super().setUp call

New policy code requires that CONF is already initialized when policy
checks are invoked. It means that no Neutron context objects should be
created before BaseTestCase.setUp() is called that will set
configuration, among other things.

Ideally, we would just make sure that all test cases invoke
super().setUp() as the very first line of any subclass setUp() methods.
But since some of test cases require prior setup (like mocking extension
manager) before proceeding to base class, we end up with magically
shuffling context instantiations to occur below super() calls.

Change-Id: Ib1039ea1ff9480ca57f9cb0c917469d0d2ad28b8
Closes-Bug: #1400301
neutron/tests/unit/ml2/drivers/brocade/test_brocade_l3_plugin.py
neutron/tests/unit/test_agent_ext_plugin.py
neutron/tests/unit/vmware/extensions/test_maclearning.py