Move V2.1 API unittest to top level directory
This patch moves the tests in contrib/ and plugins/v3/ into the base directory. Note that some of the tests have both v2 and v21 tests, The v2 tests will be deleted when V2 API removed. Co-Authored-By: Ed Leafe <ed@leafe.com> Change-Id: I6ff1d6594e7a44f2bcb6bbb04a4277b98d1cac74 Partial-Bug: #1462901
This commit is contained in:
parent
003a2f6fcb
commit
74328ce719
|
@ -18,7 +18,7 @@ from oslo_config import cfg
|
|||
from nova.api.openstack.compute import fping
|
||||
from nova.api.openstack.compute.legacy_v2.contrib import fping as fping_v2
|
||||
from nova.tests.functional.v3 import test_servers
|
||||
from nova.tests.unit.api.openstack.compute.contrib import test_fping
|
||||
from nova.tests.unit.api.openstack.compute import test_fping
|
||||
from nova import utils
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
|
|
@ -17,7 +17,7 @@ from oslo_config import cfg
|
|||
|
||||
from nova.network import api as network_api
|
||||
from nova.tests.functional.v3 import api_sample_base
|
||||
from nova.tests.unit.api.openstack.compute.contrib import test_networks
|
||||
from nova.tests.unit.api.openstack.compute import test_networks
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('osapi_compute_extension',
|
||||
|
|
|
@ -18,7 +18,7 @@ from oslo_utils import timeutils
|
|||
|
||||
from nova import db
|
||||
from nova.tests.functional.v3 import api_sample_base
|
||||
from nova.tests.unit.api.openstack.compute.contrib import test_services
|
||||
from nova.tests.unit.api.openstack.compute import test_services
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('osapi_compute_extension',
|
||||
|
|
|
@ -57,7 +57,7 @@ from nova.objects import base as obj_base
|
|||
from nova.openstack.common import policy as common_policy
|
||||
from nova import policy
|
||||
from nova import test
|
||||
from nova.tests.unit.api.openstack.compute.contrib import (
|
||||
from nova.tests.unit.api.openstack.compute import (
|
||||
test_neutron_security_groups as test_neutron)
|
||||
from nova.tests.unit import cast_as_call
|
||||
from nova.tests.unit import fake_block_device
|
||||
|
|
|
@ -24,7 +24,7 @@ from nova.api.openstack import extensions
|
|||
from nova import exception
|
||||
from nova import objects
|
||||
from nova import test
|
||||
from nova.tests.unit.api.openstack.compute.contrib import test_hypervisors
|
||||
from nova.tests.unit.api.openstack.compute import test_hypervisors
|
||||
from nova.tests.unit.api.openstack import fakes
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ from nova.api.openstack.compute.legacy_v2.contrib import hypervisors \
|
|||
from nova.api.openstack import extensions
|
||||
from nova import objects
|
||||
from nova import test
|
||||
from nova.tests.unit.api.openstack.compute.contrib import test_hypervisors
|
||||
from nova.tests.unit.api.openstack.compute import test_hypervisors
|
||||
|
||||
TEST_HYPER = test_hypervisors.TEST_HYPERS_OBJ[0].obj_clone()
|
||||
TEST_SERVICE = objects.Service(id=1,
|
|
@ -429,7 +429,7 @@ class NetworksTestV21(test.NoDBTestCase):
|
|||
res_dict = self.controller.show(self.admin_req, uuid)
|
||||
self.assertEqual(res_dict['network']['project_id'], 'fake')
|
||||
|
||||
@mock.patch('nova.tests.unit.api.openstack.compute.contrib.test_networks.'
|
||||
@mock.patch('nova.tests.unit.api.openstack.compute.test_networks.'
|
||||
'FakeNetworkAPI.add_network_to_project',
|
||||
side_effect=exception.NoMoreNetworks)
|
||||
def test_network_add_no_more_networks_fail(self, mock_add):
|
||||
|
@ -437,7 +437,7 @@ class NetworksTestV21(test.NoDBTestCase):
|
|||
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.add,
|
||||
self.req, body={'id': uuid})
|
||||
|
||||
@mock.patch('nova.tests.unit.api.openstack.compute.contrib.test_networks.'
|
||||
@mock.patch('nova.tests.unit.api.openstack.compute.test_networks.'
|
||||
'FakeNetworkAPI.add_network_to_project',
|
||||
side_effect=exception.NetworkNotFoundForUUID(uuid='fake_uuid'))
|
||||
def test_network_add_network_not_found_networks_fail(self, mock_add):
|
|
@ -32,7 +32,7 @@ from nova.network.neutronv2 import api as neutron_api
|
|||
from nova.network.security_group import neutron_driver
|
||||
from nova.objects import instance as instance_obj
|
||||
from nova import test
|
||||
from nova.tests.unit.api.openstack.compute.contrib import test_security_groups
|
||||
from nova.tests.unit.api.openstack.compute import test_security_groups
|
||||
from nova.tests.unit.api.openstack import fakes
|
||||
|
||||
|
|
@ -300,7 +300,7 @@ class ServersControllerTest(ControllerTest):
|
|||
self.assertEqual([(None, None, port, None)], res.as_tuples())
|
||||
|
||||
def test_requested_networks_neutronv2_subclass_with_port(self):
|
||||
cls = ('nova.tests.unit.api.openstack.compute.plugins.v3'
|
||||
cls = ('nova.tests.unit.api.openstack.compute'
|
||||
'.test_servers.NeutronV2Subclass')
|
||||
self.flags(network_api_class=cls)
|
||||
port = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
Loading…
Reference in New Issue