Do not use nova.test in placement.test_microversion

The tests are very straightforward and do not require any of the setup
and fixtures that nova.test.NoDBTestCase supplies. Also, in the future
of placement extraction we don't want the dependecy.

Partially implements blueprint placement-extract

Change-Id: I05498a30646d8e718c700fcedff4657907062982
This commit is contained in:
Chris Dent 2018-06-11 20:12:22 +01:00 committed by jichenjc
parent 1201aab0ff
commit 288972be76
1 changed files with 5 additions and 5 deletions

View File

@ -14,6 +14,7 @@
import collections
import operator
import testtools
import webob
import microversion_parse
@ -22,14 +23,13 @@ import mock
# import the handlers to load up handler decorators
import nova.api.openstack.placement.handler # noqa
from nova.api.openstack.placement import microversion
from nova import test
def handler():
return True
class TestMicroversionFindMethod(test.NoDBTestCase):
class TestMicroversionFindMethod(testtools.TestCase):
def test_method_405(self):
self.assertRaises(webob.exc.HTTPMethodNotAllowed,
microversion._find_method, handler, '1.1', 405)
@ -39,7 +39,7 @@ class TestMicroversionFindMethod(test.NoDBTestCase):
microversion._find_method, handler, '1.1', 404)
class TestMicroversionDecoration(test.NoDBTestCase):
class TestMicroversionDecoration(testtools.TestCase):
@mock.patch('nova.api.openstack.placement.microversion.VERSIONED_METHODS',
new=collections.defaultdict(list))
@ -79,7 +79,7 @@ class TestMicroversionDecoration(test.NoDBTestCase):
handler)
class TestMicroversionIntersection(test.NoDBTestCase):
class TestMicroversionIntersection(testtools.TestCase):
"""Test that there are no overlaps in the versioned handlers."""
# If you add versioned handlers you need to update this value to
@ -138,7 +138,7 @@ class TestMicroversionIntersection(test.NoDBTestCase):
'method %s has intersecting versioned handlers' % method_name)
class MicroversionSequentialTest(test.NoDBTestCase):
class MicroversionSequentialTest(testtools.TestCase):
def test_microversion_sequential(self):
for method_name, method_list in microversion.VERSIONED_METHODS.items():