Merge "Use oslotest instead of common test module"
This commit is contained in:
@@ -21,14 +21,14 @@ import errno
|
|||||||
import socket
|
import socket
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from openstack.common import eventlet_backdoor
|
from openstack.common import eventlet_backdoor
|
||||||
from openstack.common.fixture import config
|
from openstack.common.fixture import config
|
||||||
from openstack.common.fixture import moxstubout
|
from openstack.common.fixture import moxstubout
|
||||||
from openstack.common import test
|
|
||||||
|
|
||||||
|
|
||||||
class BackdoorPortTest(test.BaseTestCase):
|
class BackdoorPortTest(test_base.BaseTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(BackdoorPortTest, self).setUp()
|
super(BackdoorPortTest, self).setUp()
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from eventlet import greenthread
|
from eventlet import greenthread
|
||||||
|
from oslotest import base as test_base
|
||||||
from six.moves import mox
|
from six.moves import mox
|
||||||
|
|
||||||
from openstack.common import loopingcall
|
from openstack.common import loopingcall
|
||||||
from openstack.common import test
|
|
||||||
from openstack.common import timeutils
|
from openstack.common import timeutils
|
||||||
|
|
||||||
|
|
||||||
class LoopingCallTestCase(test.BaseTestCase):
|
class LoopingCallTestCase(test_base.BaseTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(LoopingCallTestCase, self).setUp()
|
super(LoopingCallTestCase, self).setUp()
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ Unit Tests for periodic_task decorator and PeriodicTasks class.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from openstack.common.fixture import config
|
from openstack.common.fixture import config
|
||||||
from openstack.common import periodic_task
|
from openstack.common import periodic_task
|
||||||
from openstack.common import test
|
|
||||||
from testtools import matchers
|
from testtools import matchers
|
||||||
|
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ class AService(periodic_task.PeriodicTasks):
|
|||||||
self.called['tocks'] += 1
|
self.called['tocks'] += 1
|
||||||
|
|
||||||
|
|
||||||
class PeriodicTasksTestCase(test.BaseTestCase):
|
class PeriodicTasksTestCase(test_base.BaseTestCase):
|
||||||
"""Test cases for PeriodicTasks."""
|
"""Test cases for PeriodicTasks."""
|
||||||
|
|
||||||
@mock.patch('time.time')
|
@mock.patch('time.time')
|
||||||
@@ -92,7 +92,7 @@ class PeriodicTasksTestCase(test.BaseTestCase):
|
|||||||
None, raise_on_error=True)
|
None, raise_on_error=True)
|
||||||
|
|
||||||
|
|
||||||
class ManagerMetaTestCase(test.BaseTestCase):
|
class ManagerMetaTestCase(test_base.BaseTestCase):
|
||||||
"""Tests for the meta class which manages the creation of periodic tasks.
|
"""Tests for the meta class which manages the creation of periodic tasks.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ class ManagerMetaTestCase(test.BaseTestCase):
|
|||||||
m._periodic_spacing, matchers.Not(matchers.Contains('baz')))
|
m._periodic_spacing, matchers.Not(matchers.Contains('baz')))
|
||||||
|
|
||||||
|
|
||||||
class ManagerTestCase(test.BaseTestCase):
|
class ManagerTestCase(test_base.BaseTestCase):
|
||||||
"""Tests the periodic tasks portion of the manager class."""
|
"""Tests the periodic tasks portion of the manager class."""
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(ManagerTestCase, self).setUp()
|
super(ManagerTestCase, self).setUp()
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import eventlet
|
|||||||
from eventlet import event
|
from eventlet import event
|
||||||
import mock
|
import mock
|
||||||
import mox
|
import mox
|
||||||
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from openstack.common import eventlet_backdoor
|
from openstack.common import eventlet_backdoor
|
||||||
from openstack.common.fixture import config
|
from openstack.common.fixture import config
|
||||||
@@ -39,7 +40,6 @@ from openstack.common.fixture import moxstubout
|
|||||||
from openstack.common import log as logging
|
from openstack.common import log as logging
|
||||||
from openstack.common.notifier import api as notifier_api
|
from openstack.common.notifier import api as notifier_api
|
||||||
from openstack.common import service
|
from openstack.common import service
|
||||||
from openstack.common import test
|
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@@ -50,7 +50,7 @@ class ExtendedService(service.Service):
|
|||||||
return 'service'
|
return 'service'
|
||||||
|
|
||||||
|
|
||||||
class ServiceManagerTestCase(test.BaseTestCase):
|
class ServiceManagerTestCase(test_base.BaseTestCase):
|
||||||
"""Test cases for Services."""
|
"""Test cases for Services."""
|
||||||
def test_override_manager_method(self):
|
def test_override_manager_method(self):
|
||||||
serv = ExtendedService()
|
serv = ExtendedService()
|
||||||
@@ -68,7 +68,7 @@ class ServiceWithTimer(service.Service):
|
|||||||
self.timer_fired = self.timer_fired + 1
|
self.timer_fired = self.timer_fired + 1
|
||||||
|
|
||||||
|
|
||||||
class ServiceTestBase(test.BaseTestCase):
|
class ServiceTestBase(test_base.BaseTestCase):
|
||||||
"""A base class for ServiceLauncherTest and ServiceRestartTest."""
|
"""A base class for ServiceLauncherTest and ServiceRestartTest."""
|
||||||
|
|
||||||
def _wait(self, cond, timeout):
|
def _wait(self, cond, timeout):
|
||||||
@@ -285,7 +285,7 @@ class _Service(service.Service):
|
|||||||
super(_Service, self).stop()
|
super(_Service, self).stop()
|
||||||
|
|
||||||
|
|
||||||
class LauncherTest(test.BaseTestCase):
|
class LauncherTest(test_base.BaseTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(LauncherTest, self).setUp()
|
super(LauncherTest, self).setUp()
|
||||||
|
|||||||
@@ -14,11 +14,12 @@
|
|||||||
|
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from openstack.common import sslutils
|
from openstack.common import sslutils
|
||||||
from openstack.common import test
|
|
||||||
|
|
||||||
|
|
||||||
class SSLUtilsTest(test.BaseTestCase):
|
class SSLUtilsTest(test_base.BaseTestCase):
|
||||||
def test_valid_versions(self):
|
def test_valid_versions(self):
|
||||||
self.assertEqual(sslutils.validate_ssl_version("SSLv3"),
|
self.assertEqual(sslutils.validate_ssl_version("SSLv3"),
|
||||||
ssl.PROTOCOL_SSLv3)
|
ssl.PROTOCOL_SSLv3)
|
||||||
|
|||||||
@@ -15,12 +15,13 @@
|
|||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from openstack.common.fixture import moxstubout
|
from openstack.common.fixture import moxstubout
|
||||||
from openstack.common import systemd
|
from openstack.common import systemd
|
||||||
from openstack.common import test
|
|
||||||
|
|
||||||
|
|
||||||
class SystemdTestCase(test.BaseTestCase):
|
class SystemdTestCase(test_base.BaseTestCase):
|
||||||
"""Test case for Systemd service readiness."""
|
"""Test case for Systemd service readiness."""
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(SystemdTestCase, self).setUp()
|
super(SystemdTestCase, self).setUp()
|
||||||
|
|||||||
@@ -17,11 +17,12 @@
|
|||||||
Unit Tests for thread groups
|
Unit Tests for thread groups
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from openstack.common import test
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from openstack.common import threadgroup
|
from openstack.common import threadgroup
|
||||||
|
|
||||||
|
|
||||||
class ThreadGroupTestCase(test.BaseTestCase):
|
class ThreadGroupTestCase(test_base.BaseTestCase):
|
||||||
"""Test cases for thread group."""
|
"""Test cases for thread group."""
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(ThreadGroupTestCase, self).setUp()
|
super(ThreadGroupTestCase, self).setUp()
|
||||||
|
|||||||
Reference in New Issue
Block a user