Use same naming convention everywhere for test classes
Change-Id: If619973f203a811dedd5fdfd9a6c32373e3afe85
This commit is contained in:
parent
1f62249bae
commit
4793264851
@ -20,10 +20,10 @@ from almanach.core import exception
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class KeystoneAuthenticationTest(base.BaseTestCase):
|
||||
class TestKeystoneAuthentication(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(KeystoneAuthenticationTest, self).setUp()
|
||||
super(TestKeystoneAuthentication, self).setUp()
|
||||
self.session_mock = mock.patch('keystoneauth1.session.Session').start()
|
||||
self.keystone_mock = mock.patch('keystoneclient.v3.client.Client').start()
|
||||
|
||||
|
@ -23,10 +23,10 @@ from almanach.core import exception
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class MixedAuthenticationTest(base.BaseTestCase):
|
||||
class TestMixedAuthentication(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(MixedAuthenticationTest, self).setUp()
|
||||
super(TestMixedAuthentication, self).setUp()
|
||||
self.auth_one = flexmock()
|
||||
self.auth_two = flexmock()
|
||||
self.auth_backend = mixed_auth.MixedAuthentication([self.auth_one, self.auth_two])
|
||||
|
@ -22,10 +22,10 @@ from almanach.core import exception
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class PrivateKeyAuthenticationTest(base.BaseTestCase):
|
||||
class TestPrivateKeyAuthentication(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(PrivateKeyAuthenticationTest, self).setUp()
|
||||
super(TestPrivateKeyAuthentication, self).setUp()
|
||||
self.auth_backend = private_key_auth.PrivateKeyAuthentication("my token")
|
||||
|
||||
def test_with_correct_token(self):
|
||||
|
@ -22,9 +22,10 @@ from almanach.api import auth_adapter
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class AuthenticationAdapterTest(base.BaseTestCase):
|
||||
class TestAuthenticationAdapter(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticationAdapterTest, self).setUp()
|
||||
super(TestAuthenticationAdapter, self).setUp()
|
||||
self.auth_adapter = auth_adapter.AuthenticationAdapter(self.config)
|
||||
|
||||
def test_assert_that_the_default_backend_is_private_key(self):
|
||||
|
0
almanach/tests/unit/api/v1/__init__.py
Normal file
0
almanach/tests/unit/api/v1/__init__.py
Normal file
@ -15,13 +15,13 @@
|
||||
from hamcrest import assert_that
|
||||
from hamcrest import equal_to
|
||||
|
||||
from almanach.tests.unit.api import base_api
|
||||
from almanach.tests.unit.api.v1 import base_api
|
||||
|
||||
|
||||
class ApiAuthenticationTest(base_api.BaseApi):
|
||||
class TestApiAuthentication(base_api.BaseApi):
|
||||
|
||||
def setUp(self):
|
||||
super(ApiAuthenticationTest, self).setUp()
|
||||
super(TestApiAuthentication, self).setUp()
|
||||
self.prepare()
|
||||
self.prepare_with_failed_authentication()
|
||||
|
@ -20,12 +20,12 @@ from hamcrest import is_
|
||||
from voluptuous import Invalid
|
||||
|
||||
from almanach.core import exception
|
||||
from almanach.tests.unit.api import base_api
|
||||
from almanach.tests.unit.api.v1 import base_api
|
||||
from almanach.tests.unit.builders.entity import a
|
||||
from almanach.tests.unit.builders.entity import instance
|
||||
|
||||
|
||||
class ApiEntityTest(base_api.BaseApi):
|
||||
class TestApiEntity(base_api.BaseApi):
|
||||
|
||||
def test_update_instance_flavor_for_terminated_instance(self):
|
||||
some_new_flavor = 'some_new_flavor'
|
@ -16,10 +16,10 @@ from hamcrest import assert_that
|
||||
from hamcrest import equal_to
|
||||
from hamcrest import has_key
|
||||
|
||||
from almanach.tests.unit.api import base_api
|
||||
from almanach.tests.unit.api.v1 import base_api
|
||||
|
||||
|
||||
class ApiInfoTest(base_api.BaseApi):
|
||||
class TestApiInfo(base_api.BaseApi):
|
||||
|
||||
def test_info(self):
|
||||
self.app_ctl.should_receive('get_application_info').and_return({
|
@ -19,12 +19,12 @@ from hamcrest import has_key
|
||||
from hamcrest import has_length
|
||||
|
||||
from almanach.core import exception
|
||||
from almanach.tests.unit.api import base_api
|
||||
from almanach.tests.unit.api.v1 import base_api
|
||||
from almanach.tests.unit.builders.entity import a
|
||||
from almanach.tests.unit.builders.entity import instance
|
||||
|
||||
|
||||
class ApiInstanceTest(base_api.BaseApi):
|
||||
class TestApiInstance(base_api.BaseApi):
|
||||
|
||||
def test_get_instances(self):
|
||||
self.instance_ctl.should_receive('list_instances') \
|
@ -18,10 +18,10 @@ from hamcrest import has_entries
|
||||
from uuid import uuid4
|
||||
|
||||
from almanach.core import exception
|
||||
from almanach.tests.unit.api import base_api
|
||||
from almanach.tests.unit.api.v1 import base_api
|
||||
|
||||
|
||||
class ApiVolumeTest(base_api.BaseApi):
|
||||
class TestApiVolume(base_api.BaseApi):
|
||||
|
||||
def test_successful_volume_create(self):
|
||||
data = dict(volume_id="VOLUME_ID",
|
@ -20,12 +20,12 @@ from hamcrest import has_key
|
||||
from hamcrest import has_length
|
||||
|
||||
from almanach.core import exception
|
||||
from almanach.tests.unit.api import base_api
|
||||
from almanach.tests.unit.api.v1 import base_api
|
||||
from almanach.tests.unit.builders.entity import a
|
||||
from almanach.tests.unit.builders.entity import volume_type
|
||||
|
||||
|
||||
class ApiVolumeTypeTest(base_api.BaseApi):
|
||||
class TestApiVolumeType(base_api.BaseApi):
|
||||
|
||||
def test_get_volume_types(self):
|
||||
self.volume_type_ctl.should_receive('list_volume_types') \
|
@ -19,10 +19,10 @@ from almanach.tests.unit import base
|
||||
from almanach.tests.unit.builders import notification as builder
|
||||
|
||||
|
||||
class InstanceHandlerTest(base.BaseTestCase):
|
||||
class TestInstanceHandler(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(InstanceHandlerTest, self).setUp()
|
||||
super(TestInstanceHandler, self).setUp()
|
||||
self.controller = mock.Mock()
|
||||
self.instance_handler = instance_handler.InstanceHandler(self.controller)
|
||||
|
||||
|
@ -19,10 +19,10 @@ from almanach.tests.unit import base
|
||||
from almanach.tests.unit.builders import notification as builder
|
||||
|
||||
|
||||
class VolumeHandlerTest(base.BaseTestCase):
|
||||
class TestVolumeHandler(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(VolumeHandlerTest, self).setUp()
|
||||
super(TestVolumeHandler, self).setUp()
|
||||
self.controller = mock.Mock()
|
||||
self.volume_handler = volume_handler.VolumeHandler(self.controller)
|
||||
|
||||
|
@ -19,10 +19,10 @@ from almanach.tests.unit import base
|
||||
from almanach.tests.unit.builders import notification as builder
|
||||
|
||||
|
||||
class VolumeTypeHandlerTest(base.BaseTestCase):
|
||||
class TestVolumeTypeHandler(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(VolumeTypeHandlerTest, self).setUp()
|
||||
super(TestVolumeTypeHandler, self).setUp()
|
||||
self.controller = mock.Mock()
|
||||
self.volume_type_handler = volume_type_handler.VolumeTypeHandler(self.controller)
|
||||
|
||||
|
@ -19,10 +19,10 @@ from almanach.collector import messaging
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class MessagingFactoryTest(base.BaseTestCase):
|
||||
class TestMessagingFactory(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(MessagingFactoryTest, self).setUp()
|
||||
super(TestMessagingFactory, self).setUp()
|
||||
self.factory = messaging.MessagingFactory(self.config)
|
||||
|
||||
def test_get_listener(self):
|
||||
|
@ -18,10 +18,10 @@ from almanach.collector import notification
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class NotificationTest(base.BaseTestCase):
|
||||
class TestNotification(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(NotificationTest, self).setUp()
|
||||
super(TestNotification, self).setUp()
|
||||
|
||||
self.config_fixture.config(retry_delay=0, group='collector')
|
||||
self.config_fixture.config(max_retries=3, group='collector')
|
||||
|
@ -18,10 +18,10 @@ import mock
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class ServiceFactoryTest(base.BaseTestCase):
|
||||
class TestServiceFactory(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(ServiceFactoryTest, self).setUp()
|
||||
super(TestServiceFactory, self).setUp()
|
||||
self.core_factory = mock.Mock()
|
||||
self.factory = service.ServiceFactory(self.config, self.core_factory)
|
||||
|
||||
|
@ -31,10 +31,10 @@ from almanach.tests.unit.builders.entity import a
|
||||
from almanach.tests.unit.builders.entity import instance
|
||||
|
||||
|
||||
class EntityControllerTest(base.BaseTestCase):
|
||||
class TestEntityController(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(EntityControllerTest, self).setUp()
|
||||
super(TestEntityController, self).setUp()
|
||||
self.database_adapter = flexmock(base_driver.BaseDriver)
|
||||
self.controller = entity_controller.EntityController(self.database_adapter)
|
||||
|
||||
|
@ -27,10 +27,10 @@ from almanach.tests.unit.builders.entity import a
|
||||
from almanach.tests.unit.builders.entity import instance
|
||||
|
||||
|
||||
class InstanceControllerTest(base.BaseTestCase):
|
||||
class TestInstanceController(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(InstanceControllerTest, self).setUp()
|
||||
super(TestInstanceController, self).setUp()
|
||||
self.config.entities.instance_image_meta = ['distro', 'version', 'os_type']
|
||||
self.database_adapter = flexmock(base_driver.BaseDriver)
|
||||
self.controller = instance_controller.InstanceController(self.config, self.database_adapter)
|
||||
|
@ -29,10 +29,10 @@ from almanach.tests.unit.builders.entity import volume
|
||||
from almanach.tests.unit.builders.entity import volume_type
|
||||
|
||||
|
||||
class VolumeControllerTest(base.BaseTestCase):
|
||||
class TestVolumeController(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(VolumeControllerTest, self).setUp()
|
||||
super(TestVolumeController, self).setUp()
|
||||
self.database_adapter = flexmock(base_driver.BaseDriver)
|
||||
self.controller = volume_controller.VolumeController(self.config, self.database_adapter)
|
||||
|
||||
|
@ -20,10 +20,10 @@ from almanach.tests.unit.builders.entity import a
|
||||
from almanach.tests.unit.builders.entity import volume_type
|
||||
|
||||
|
||||
class VolumeTypeControllerTest(base.BaseTestCase):
|
||||
class TestVolumeTypeController(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(VolumeTypeControllerTest, self).setUp()
|
||||
super(TestVolumeTypeController, self).setUp()
|
||||
self.database_adapter = mock.Mock()
|
||||
self.controller = volume_type_controller.VolumeTypeController(self.database_adapter)
|
||||
|
||||
|
@ -23,10 +23,10 @@ import mock
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class FactoryTest(base.BaseTestCase):
|
||||
class TestFactory(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(FactoryTest, self).setUp()
|
||||
super(TestFactory, self).setUp()
|
||||
self.storage = mock.Mock()
|
||||
self.factory = factory.Factory(self.config, self.storage)
|
||||
|
||||
|
@ -27,10 +27,10 @@ from almanach.tests.unit.builders.entity import volume
|
||||
from almanach.tests.unit.builders.entity import volume_type
|
||||
|
||||
|
||||
class MongoDbDriverTest(base.BaseTestCase):
|
||||
class TestMongoDbDriver(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(MongoDbDriverTest, self).setUp()
|
||||
super(TestMongoDbDriver, self).setUp()
|
||||
mongo_connection = mongomock.Connection()
|
||||
self.db = mongo_connection['almanach']
|
||||
self.adapter = mongodb_driver.MongoDbDriver(self.config, self.db)
|
||||
|
@ -19,10 +19,10 @@ from almanach.storage import storage_driver
|
||||
from almanach.tests.unit import base
|
||||
|
||||
|
||||
class StorageDriverTest(base.BaseTestCase):
|
||||
class TestStorageDriver(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(StorageDriverTest, self).setUp()
|
||||
super(TestStorageDriver, self).setUp()
|
||||
self.storage_driver = storage_driver.StorageDriver(self.config)
|
||||
|
||||
def test_get_default_database_adapter(self):
|
||||
|
@ -23,7 +23,8 @@ from almanach.core import exception
|
||||
from almanach.validators.instance_validator import InstanceValidator
|
||||
|
||||
|
||||
class InstanceValidatorTests(unittest.TestCase):
|
||||
class TestInstanceValidator(unittest.TestCase):
|
||||
|
||||
def test_validate_update_with_invalid_attribute(self):
|
||||
instance_validator = InstanceValidator()
|
||||
payload = {"invalid attribute": ".."}
|
||||
|
Loading…
Reference in New Issue
Block a user