move unit tests to subdirectory. part 2.
Change-Id: I9372f140c1499572961195baf15f09623c29e7ed
This commit is contained in:
@@ -13,10 +13,10 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
:mod:`ec2api.tests.unit` -- EC2api Unittests
|
||||
:mod:`ec2api.tests.unit.unit` -- EC2api Unittests
|
||||
=====================================================
|
||||
|
||||
.. automodule:: ec2api.tests.unit
|
||||
.. automodule:: ec2api.tests.unit.unit
|
||||
:platform: Unix
|
||||
"""
|
||||
|
||||
|
@@ -19,9 +19,9 @@ from oslotest import base as test_base
|
||||
|
||||
import ec2api.api.apirequest
|
||||
from ec2api.api import ec2utils
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
import ec2api.wsgi
|
||||
|
||||
|
@@ -18,7 +18,7 @@ import random
|
||||
import uuid
|
||||
|
||||
from ec2api.openstack.common import timeutils
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
# Helper functions section
|
@@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
XML_RESULT_TEMPLATE = '''
|
||||
<%(action)sResponse
|
@@ -20,10 +20,10 @@ from novaclient import exceptions as nova_exception
|
||||
from oslo.config import cfg
|
||||
|
||||
from ec2api.api import address
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class AddressTestCase(base.ApiTestCase):
|
||||
|
@@ -21,8 +21,8 @@ from oslotest import base as test_base
|
||||
from ec2api import api
|
||||
from ec2api.api import apirequest
|
||||
from ec2api import exception
|
||||
from ec2api.tests import fakes_request_response as fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests.unit import fakes_request_response as fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api import wsgi
|
||||
|
||||
|
||||
|
@@ -21,9 +21,9 @@ from oslo.utils import timeutils
|
||||
from oslotest import base as test_base
|
||||
|
||||
from ec2api.api import apirequest
|
||||
from ec2api.tests import fakes_request_response as fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import fakes_request_response as fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class EC2RequesterTestCase(test_base.BaseTestCase):
|
||||
|
@@ -12,9 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
|
||||
|
||||
class AvailabilityZoneCase(base.ApiTestCase):
|
||||
|
@@ -68,16 +68,16 @@ class OnCrashCleanerTestCase(test_base.BaseTestCase):
|
||||
|
||||
self.assertEqual(1, cls.call_count)
|
||||
self.assertEqual(3, log.warning.call_count)
|
||||
self.assertIn('ec2api.tests.test_common.FakeCrasherClass.'
|
||||
self.assertIn('ec2api.tests.unit.test_common.FakeCrasherClass.'
|
||||
'fake_crashed_clean_method',
|
||||
log.warning.mock_calls[0][1][0])
|
||||
for arg in ["'args'", "666", "{'key': 'value'}",
|
||||
"s='args'", "i=666", "d={'key': 'value'}"]:
|
||||
self.assertIn(arg, log.warning.mock_calls[0][1][0])
|
||||
self.assertIn('ec2api.tests.test_common.'
|
||||
self.assertIn('ec2api.tests.unit.test_common.'
|
||||
'fake_standalone_crashed_clean_method',
|
||||
log.warning.mock_calls[1][1][0])
|
||||
self.assertIn('ec2api.tests.test_common.FakeCrasherClass',
|
||||
self.assertIn('ec2api.tests.unit.test_common.FakeCrasherClass',
|
||||
log.warning.mock_calls[2][1][0])
|
||||
obj.fake_clean_method.assert_called_once_with('params')
|
||||
self.assertFalse(obj.fake_clean_method_25.called)
|
@@ -22,8 +22,8 @@ from ec2api import context as ec2_context
|
||||
from ec2api.db import api as db_api
|
||||
from ec2api.db import migration
|
||||
from ec2api.db.sqlalchemy import api as session
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
|
||||
|
||||
class DbApiTestCase(test_base.BaseTestCase):
|
||||
|
@@ -14,10 +14,10 @@
|
||||
|
||||
import mock
|
||||
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class DhcpOptionsTestCase(base.ApiTestCase):
|
||||
|
@@ -18,8 +18,8 @@ import testtools
|
||||
|
||||
from ec2api.api import ec2utils
|
||||
from ec2api import exception
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
|
||||
|
||||
class EC2UtilsTestCase(testtools.TestCase):
|
||||
|
@@ -23,10 +23,10 @@ from oslotest import base as test_base
|
||||
|
||||
from ec2api.api import image as image_api
|
||||
from ec2api import exception
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
AMI_MANIFEST_XML = """<?xml version="1.0" ?>
|
||||
|
@@ -24,10 +24,10 @@ from oslotest import base as test_base
|
||||
|
||||
from ec2api.api import instance as instance_api
|
||||
from ec2api import exception
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class InstanceTestCase(base.ApiTestCase):
|
||||
|
@@ -17,9 +17,9 @@ import mock
|
||||
from neutronclient.common import exceptions as neutron_exception
|
||||
from oslo.config import cfg
|
||||
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
|
||||
|
||||
class IgwTestCase(base.ApiTestCase):
|
||||
|
@@ -16,10 +16,10 @@ import base64
|
||||
|
||||
from novaclient import exceptions as nova_exception
|
||||
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class KeyPairCase(base.ApiTestCase):
|
||||
|
@@ -20,8 +20,8 @@ import webob
|
||||
|
||||
from ec2api import exception
|
||||
from ec2api import metadata
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
|
||||
|
||||
class ProxyTestCase(test_base.BaseTestCase):
|
||||
|
@@ -17,9 +17,9 @@ from novaclient import exceptions as nova_exception
|
||||
|
||||
from ec2api import exception
|
||||
from ec2api.metadata import api
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
|
||||
|
||||
class MetadataApiTestCase(base.ApiTestCase):
|
||||
|
@@ -19,10 +19,10 @@ import mock
|
||||
from neutronclient.common import exceptions as neutron_exception
|
||||
|
||||
from ec2api.api import ec2utils
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class NetworkInterfaceTestCase(base.ApiTestCase):
|
||||
|
@@ -20,10 +20,10 @@ import mock
|
||||
from ec2api.api import common
|
||||
from ec2api.api import ec2utils
|
||||
from ec2api.api import route_table
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class RouteTableTestCase(base.ApiTestCase):
|
||||
|
@@ -20,10 +20,10 @@ from neutronclient.common import exceptions as neutron_exception
|
||||
from novaclient import exceptions as nova_exception
|
||||
|
||||
from ec2api.api import security_group
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class SecurityGroupTestCase(base.ApiTestCase):
|
||||
|
@@ -14,10 +14,10 @@
|
||||
|
||||
import mock
|
||||
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class SnapshotTestCase(base.ApiTestCase):
|
||||
|
@@ -15,10 +15,10 @@
|
||||
import mock
|
||||
from neutronclient.common import exceptions as neutron_exception
|
||||
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class SubnetTestCase(base.ApiTestCase):
|
||||
|
@@ -16,9 +16,9 @@ import mock
|
||||
|
||||
from ec2api.api import ec2utils
|
||||
from ec2api.api import tag as tag_api
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
|
||||
|
||||
class TagTestCase(base.ApiTestCase):
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
import testtools
|
||||
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class TestToolsTestCase(testtools.TestCase):
|
||||
|
@@ -14,10 +14,10 @@
|
||||
|
||||
import mock
|
||||
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class VolumeTestCase(base.ApiTestCase):
|
||||
|
@@ -16,10 +16,10 @@
|
||||
import mock
|
||||
from neutronclient.common import exceptions as neutron_exception
|
||||
|
||||
from ec2api.tests import base
|
||||
from ec2api.tests import fakes
|
||||
from ec2api.tests import matchers
|
||||
from ec2api.tests import tools
|
||||
from ec2api.tests.unit import base
|
||||
from ec2api.tests.unit import fakes
|
||||
from ec2api.tests.unit import matchers
|
||||
from ec2api.tests.unit import tools
|
||||
|
||||
|
||||
class VpcTestCase(base.ApiTestCase):
|
||||
|
Reference in New Issue
Block a user