Merge "Follow up for: Prepare for functional testing patch"
This commit is contained in:
commit
5b819fe7f5
@ -15,7 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
"""
|
||||
:mod:`Ironic.tests` -- ironic Unittests
|
||||
:mod:`ironic.tests.unit` -- ironic unit tests
|
||||
=====================================================
|
||||
|
||||
.. automodule:: ironic.tests.unit
|
||||
|
@ -33,7 +33,7 @@ PATH_PREFIX = '/v1'
|
||||
cfg.CONF.import_group('keystone_authtoken', 'keystonemiddleware.auth_token')
|
||||
|
||||
|
||||
class FunctionalTest(base.DbTestCase):
|
||||
class BaseApiTest(base.DbTestCase):
|
||||
"""Pecan controller functional testing class.
|
||||
|
||||
Used for functional tests of Pecan controllers where you need to
|
||||
@ -44,7 +44,7 @@ class FunctionalTest(base.DbTestCase):
|
||||
SOURCE_DATA = {'test_source': {'somekey': '666'}}
|
||||
|
||||
def setUp(self):
|
||||
super(FunctionalTest, self).setUp()
|
||||
super(BaseApiTest, self).setUp()
|
||||
cfg.CONF.set_override("auth_version", "v2.0",
|
||||
group='keystone_authtoken')
|
||||
cfg.CONF.set_override("admin_user", "admin",
|
||||
|
@ -28,7 +28,7 @@ cfg.CONF.import_opt('cache', 'keystonemiddleware.auth_token',
|
||||
group='keystone_authtoken')
|
||||
|
||||
|
||||
class TestACL(base.FunctionalTest):
|
||||
class TestACL(base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestACL, self).setUp()
|
||||
|
@ -21,7 +21,7 @@ from ironic.api.controllers import base as cbase
|
||||
from ironic.tests.unit.api import base
|
||||
|
||||
|
||||
class TestBase(base.FunctionalTest):
|
||||
class TestBase(base.BaseApiTest):
|
||||
|
||||
def test_api_setup(self):
|
||||
pass
|
||||
@ -35,7 +35,7 @@ class TestBase(base.FunctionalTest):
|
||||
self.assertTrue(response.json['error_message'])
|
||||
|
||||
|
||||
class TestVersion(base.FunctionalTest):
|
||||
class TestVersion(base.BaseApiTest):
|
||||
|
||||
@mock.patch('ironic.api.controllers.base.Version.parse_headers')
|
||||
def test_init(self, mock_parse):
|
||||
|
@ -102,7 +102,7 @@ def fake_headers(admin=False):
|
||||
return headers
|
||||
|
||||
|
||||
class TestNoExceptionTracebackHook(base.FunctionalTest):
|
||||
class TestNoExceptionTracebackHook(base.BaseApiTest):
|
||||
|
||||
TRACE = [u'Traceback (most recent call last):',
|
||||
u' File "/opt/stack/ironic/ironic/openstack/common/rpc/amqp.py",'
|
||||
@ -177,7 +177,7 @@ class TestNoExceptionTracebackHook(base.FunctionalTest):
|
||||
self.assertEqual(self.MSG_WITH_TRACE, actual_msg)
|
||||
|
||||
|
||||
class TestContextHook(base.FunctionalTest):
|
||||
class TestContextHook(base.BaseApiTest):
|
||||
@mock.patch.object(context, 'RequestContext')
|
||||
def test_context_hook_not_admin(self, mock_ctx):
|
||||
headers = fake_headers(admin=False)
|
||||
@ -249,7 +249,7 @@ class TestContextHook(base.FunctionalTest):
|
||||
roles=headers['X-Roles'].split(','))
|
||||
|
||||
|
||||
class TestTrustedCallHook(base.FunctionalTest):
|
||||
class TestTrustedCallHook(base.BaseApiTest):
|
||||
def test_trusted_call_hook_not_admin(self):
|
||||
headers = fake_headers(admin=False)
|
||||
reqstate = FakeRequestState(headers=headers)
|
||||
@ -284,7 +284,7 @@ class TestTrustedCallHookCompatJuno(TestTrustedCallHook):
|
||||
self.skipTest('no public_api trusted call policy in juno')
|
||||
|
||||
|
||||
class TestPublicUrlHook(base.FunctionalTest):
|
||||
class TestPublicUrlHook(base.BaseApiTest):
|
||||
|
||||
def test_before_host_url(self):
|
||||
headers = fake_headers()
|
||||
|
@ -16,7 +16,7 @@
|
||||
from ironic.tests.unit.api import base
|
||||
|
||||
|
||||
class TestRoot(base.FunctionalTest):
|
||||
class TestRoot(base.BaseApiTest):
|
||||
|
||||
def test_get_root(self):
|
||||
data = self.get_json('/', path_prefix='')
|
||||
@ -25,7 +25,7 @@ class TestRoot(base.FunctionalTest):
|
||||
[self.assertNotIn(f, ['', []]) for f in data.keys()]
|
||||
|
||||
|
||||
class TestV1Root(base.FunctionalTest):
|
||||
class TestV1Root(base.BaseApiTest):
|
||||
|
||||
def test_get_v1_root(self):
|
||||
data = self.get_json('/')
|
||||
|
@ -44,7 +44,7 @@ class TestChassisObject(base.TestCase):
|
||||
self.assertEqual(wtypes.Unset, chassis.description)
|
||||
|
||||
|
||||
class TestListChassis(test_api_base.FunctionalTest):
|
||||
class TestListChassis(test_api_base.BaseApiTest):
|
||||
|
||||
def test_empty(self):
|
||||
data = self.get_json('/chassis')
|
||||
@ -231,7 +231,7 @@ class TestListChassis(test_api_base.FunctionalTest):
|
||||
self.assertEqual(http_client.NOT_FOUND, response.status_int)
|
||||
|
||||
|
||||
class TestPatch(test_api_base.FunctionalTest):
|
||||
class TestPatch(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPatch, self).setUp()
|
||||
@ -379,7 +379,7 @@ class TestPatch(test_api_base.FunctionalTest):
|
||||
self.assertTrue(response.json['error_message'])
|
||||
|
||||
|
||||
class TestPost(test_api_base.FunctionalTest):
|
||||
class TestPost(test_api_base.BaseApiTest):
|
||||
|
||||
@mock.patch.object(timeutils, 'utcnow')
|
||||
def test_create_chassis(self, mock_utcnow):
|
||||
@ -446,7 +446,7 @@ class TestPost(test_api_base.FunctionalTest):
|
||||
self.assertEqual(descr, result['description'])
|
||||
|
||||
|
||||
class TestDelete(test_api_base.FunctionalTest):
|
||||
class TestDelete(test_api_base.BaseApiTest):
|
||||
|
||||
def test_delete_chassis(self):
|
||||
chassis = obj_utils.create_test_chassis(self.context)
|
||||
|
@ -27,7 +27,7 @@ from ironic.conductor import rpcapi
|
||||
from ironic.tests.unit.api import base
|
||||
|
||||
|
||||
class TestListDrivers(base.FunctionalTest):
|
||||
class TestListDrivers(base.BaseApiTest):
|
||||
d1 = 'fake-driver1'
|
||||
d2 = 'fake-driver2'
|
||||
h1 = 'fake-host1'
|
||||
@ -274,7 +274,7 @@ class TestListDrivers(base.FunctionalTest):
|
||||
|
||||
@mock.patch.object(rpcapi.ConductorAPI, 'get_driver_properties')
|
||||
@mock.patch.object(rpcapi.ConductorAPI, 'get_topic_for_driver')
|
||||
class TestDriverProperties(base.FunctionalTest):
|
||||
class TestDriverProperties(base.BaseApiTest):
|
||||
|
||||
def test_driver_properties_fake(self, mock_topic, mock_properties):
|
||||
# Can get driver properties for fake driver.
|
||||
|
@ -52,7 +52,7 @@ class TestNodeObject(base.TestCase):
|
||||
self.assertEqual(wtypes.Unset, node.instance_uuid)
|
||||
|
||||
|
||||
class TestListNodes(test_api_base.FunctionalTest):
|
||||
class TestListNodes(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestListNodes, self).setUp()
|
||||
@ -837,7 +837,7 @@ class TestListNodes(test_api_base.FunctionalTest):
|
||||
mock_vdi.assert_called_once_with(mock.ANY, node.uuid, 'test-topic')
|
||||
|
||||
|
||||
class TestPatch(test_api_base.FunctionalTest):
|
||||
class TestPatch(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPatch, self).setUp()
|
||||
@ -1307,7 +1307,7 @@ class TestPatch(test_api_base.FunctionalTest):
|
||||
self.assertEqual(http_client.OK, response.status_code)
|
||||
|
||||
|
||||
class TestPost(test_api_base.FunctionalTest):
|
||||
class TestPost(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPost, self).setUp()
|
||||
@ -1592,7 +1592,7 @@ class TestPost(test_api_base.FunctionalTest):
|
||||
self.assertFalse(get_methods_mock.called)
|
||||
|
||||
|
||||
class TestDelete(test_api_base.FunctionalTest):
|
||||
class TestDelete(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestDelete, self).setUp()
|
||||
@ -1707,7 +1707,7 @@ class TestDelete(test_api_base.FunctionalTest):
|
||||
topic='test-topic')
|
||||
|
||||
|
||||
class TestPut(test_api_base.FunctionalTest):
|
||||
class TestPut(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPut, self).setUp()
|
||||
|
@ -58,7 +58,7 @@ class TestPortObject(base.TestCase):
|
||||
self.assertEqual(wtypes.Unset, port.extra)
|
||||
|
||||
|
||||
class TestListPorts(test_api_base.FunctionalTest):
|
||||
class TestListPorts(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestListPorts, self).setUp()
|
||||
@ -343,7 +343,7 @@ class TestListPorts(test_api_base.FunctionalTest):
|
||||
|
||||
|
||||
@mock.patch.object(rpcapi.ConductorAPI, 'update_port')
|
||||
class TestPatch(test_api_base.FunctionalTest):
|
||||
class TestPatch(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPatch, self).setUp()
|
||||
@ -643,7 +643,7 @@ class TestPatch(test_api_base.FunctionalTest):
|
||||
self.assertEqual(address.lower(), kargs.address)
|
||||
|
||||
|
||||
class TestPost(test_api_base.FunctionalTest):
|
||||
class TestPost(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPost, self).setUp()
|
||||
@ -772,7 +772,7 @@ class TestPost(test_api_base.FunctionalTest):
|
||||
|
||||
|
||||
@mock.patch.object(rpcapi.ConductorAPI, 'destroy_port')
|
||||
class TestDelete(test_api_base.FunctionalTest):
|
||||
class TestDelete(test_api_base.BaseApiTest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestDelete, self).setUp()
|
||||
|
@ -20,7 +20,7 @@ from ironic.tests.unit.api import base as api_base
|
||||
from ironic.tests.unit import base as test_base
|
||||
|
||||
|
||||
class TestV1Routing(api_base.FunctionalTest):
|
||||
class TestV1Routing(api_base.BaseApiTest):
|
||||
def setUp(self):
|
||||
super(TestV1Routing, self).setUp()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user