Move unit tests to tests/unit folder
As part of the functional tests implementation defined in [1], the first
step is to reorganize the existing tests and fixtures:
- Unit tests should go to watcher/tests/unit
- Fixtures related content go to watcher/tests/fixtures
I am also adding new tox environment setting the tests paths explicitely
to the units folder unit{,-py310,-py311,-py312,-py313}
[1] https://specs.openstack.org/openstack/watcher-specs/specs/2026.1/approved/functional-testing.html
Implements: blueprint functional-test-infrastructure
Assisted-By: claude-code (claude-sonnet-4.5)
Change-Id: I97025d7405ceca1ed376e9e92d57bdb180809087
Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
This commit is contained in:
8
tox.ini
8
tox.ini
@@ -1,10 +1,8 @@
|
||||
[tox]
|
||||
minversion = 3.18.0
|
||||
envlist = py3,pep8
|
||||
ignore_basepython_conflict = True
|
||||
|
||||
[testenv]
|
||||
basepython = python3
|
||||
usedevelop = True
|
||||
allowlist_externals = find
|
||||
rm
|
||||
@@ -47,6 +45,12 @@ commands =
|
||||
find . -type f -name "*.py[c|o]" -delete
|
||||
stestr run {posargs}
|
||||
|
||||
[testenv:{unit,py3,py310,py311,py312,py313}]
|
||||
commands =
|
||||
rm -f .testrepository/times.dbm
|
||||
find . -type f -name "*.py[c|o]" -delete
|
||||
stestr --test-path=./watcher/tests/unit run {posargs}
|
||||
|
||||
[testenv:pep8]
|
||||
description =
|
||||
Run style checks.
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# Copyright 2010 United States Government as represented by the
|
||||
# Administrator of the National Aeronautics and Space Administration.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# NOTE(sean-k-mooney): watcher does not split up the tests that need eventlet
|
||||
# and those that do not currently so we need to monkey patch all the tests.
|
||||
# as an example the watcher.test.cmd module is importing watcher.cmd,
|
||||
# that has the side effect of monkey patching the test executor
|
||||
# after many modules are already imported.
|
||||
from watcher import eventlet
|
||||
eventlet.patch()
|
||||
|
||||
# NOTE(dviroel): oslo service backend needs to be initialize
|
||||
# as soon as possible, before importing oslo service. If eventlet
|
||||
# patching is enabled, it should be patched before calling this
|
||||
# function
|
||||
from watcher.common import oslo_service_helper as helper # noqa E402
|
||||
helper.init_oslo_service_backend()
|
||||
|
||||
from watcher import objects # noqa E402
|
||||
|
||||
# NOTE(comstud): Make sure we have all of the objects loaded. We do this
|
||||
# at module import time, because we may be using mock decorators in our
|
||||
# tests that run at import time.
|
||||
objects.register_all()
|
||||
|
||||
@@ -20,7 +20,7 @@ from oslo_policy import _parser
|
||||
from oslo_policy import opts as policy_opts
|
||||
|
||||
from watcher.common import policy as watcher_policy
|
||||
from watcher.tests import fake_policy
|
||||
from watcher.tests.fixtures import fake_policy
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
36
watcher/tests/unit/__init__.py
Normal file
36
watcher/tests/unit/__init__.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# Copyright 2010 United States Government as represented by the
|
||||
# Administrator of the National Aeronautics and Space Administration.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# NOTE(sean-k-mooney): watcher does not split up the tests that need eventlet
|
||||
# and those that do not currently so we need to monkey patch all the tests.
|
||||
# as an example the watcher.test.cmd module is importing watcher.cmd,
|
||||
# that has the side effect of monkey patching the test executor
|
||||
# after many modules are already imported.
|
||||
from watcher import eventlet
|
||||
eventlet.patch()
|
||||
|
||||
# NOTE(dviroel): oslo service backend needs to be initialize
|
||||
# as soon as possible, before importing oslo service. If eventlet
|
||||
# patching is enabled, it should be patched before calling this
|
||||
# function
|
||||
from watcher.common import oslo_service_helper as helper # noqa E402
|
||||
helper.init_oslo_service_backend()
|
||||
|
||||
from watcher import objects # noqa E402
|
||||
|
||||
# NOTE(comstud): Make sure we have all of the objects loaded. We do this
|
||||
# at module import time, because we may be using mock decorators in our
|
||||
# tests that run at import time.
|
||||
objects.register_all()
|
||||
@@ -32,7 +32,7 @@ import pecan.testing
|
||||
from watcher.api import hooks
|
||||
from watcher.common import context as watcher_context
|
||||
from watcher.notifications import service as n_service
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.unit.db import base
|
||||
|
||||
PATH_PREFIX = '/v1'
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
from http import HTTPStatus
|
||||
|
||||
from watcher.tests.api import base
|
||||
from watcher.tests.unit.api import base
|
||||
|
||||
|
||||
class TestBase(base.FunctionalTest):
|
||||
@@ -15,7 +15,7 @@
|
||||
import importlib
|
||||
from oslo_config import cfg
|
||||
from watcher.api import config as api_config
|
||||
from watcher.tests.api import base
|
||||
from watcher.tests.unit.api import base
|
||||
|
||||
|
||||
class TestRoot(base.FunctionalTest):
|
||||
@@ -21,7 +21,7 @@ from unittest import mock
|
||||
from watcher.api.controllers import root
|
||||
from watcher.api import hooks
|
||||
from watcher.common import context
|
||||
from watcher.tests.api import base
|
||||
from watcher.tests.unit.api import base
|
||||
|
||||
|
||||
class FakeRequest:
|
||||
@@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from watcher.tests.api import base
|
||||
from watcher.tests.unit.api import base
|
||||
|
||||
|
||||
class TestRoot(base.FunctionalTest):
|
||||
@@ -17,7 +17,7 @@ from oslo_config import cfg
|
||||
import wsme
|
||||
|
||||
from watcher.api.controllers.v1 import utils as v1_utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestApiUtilsValidScenarios(base.TestCase):
|
||||
@@ -23,7 +23,7 @@ from watcher.api.controllers.v1 import action as action_ctrl
|
||||
from watcher.api.controllers.v1 import action_plan as action_plan_ctrl
|
||||
from watcher.api.controllers.v1 import audit as audit_ctrl
|
||||
from watcher.api.controllers.v1 import audit_template as audit_template_ctrl
|
||||
from watcher.tests.db import utils as db_utils
|
||||
from watcher.tests.unit.db import utils as db_utils
|
||||
|
||||
|
||||
ADMIN_TOKEN = '4562138218392831'
|
||||
@@ -22,11 +22,11 @@ from watcher.api.controllers.v1 import action as api_action
|
||||
from watcher.common import utils
|
||||
from watcher.db import api as db_api
|
||||
from watcher import objects
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.api import utils as api_utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.db import utils as db_utils
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.api import utils as api_utils
|
||||
from watcher.tests.unit import base
|
||||
from watcher.tests.unit.db import utils as db_utils
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
def post_get_test_action(**kw):
|
||||
@@ -22,8 +22,8 @@ from watcher.applier import rpcapi as aapi
|
||||
from watcher.common import utils
|
||||
from watcher.db import api as db_api
|
||||
from watcher import objects
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestListActionPlan(api_base.FunctionalTest):
|
||||
@@ -26,11 +26,11 @@ from watcher.api.controllers.v1 import audit_template as api_audit_template
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils
|
||||
from watcher import objects
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.api import utils as api_utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.db import utils as db_utils
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.api import utils as api_utils
|
||||
from watcher.tests.unit import base
|
||||
from watcher.tests.unit.db import utils as db_utils
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
def post_get_test_audit_template(**kw):
|
||||
@@ -28,11 +28,11 @@ from watcher.db import api as db_api
|
||||
from watcher.decision_engine import rpcapi as deapi
|
||||
from watcher.decision_engine.strategy import strategies
|
||||
from watcher import objects
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.api import utils as api_utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.db import utils as db_utils
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.api import utils as api_utils
|
||||
from watcher.tests.unit import base
|
||||
from watcher.tests.unit.db import utils as db_utils
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
def post_get_test_audit(**kw):
|
||||
@@ -21,8 +21,8 @@ from oslo_serialization import jsonutils
|
||||
|
||||
from watcher.api.controllers.v1 import versions
|
||||
from watcher.decision_engine import rpcapi as deapi
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.decision_engine.model import faker_cluster_state
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.decision_engine.model import faker_cluster_state
|
||||
|
||||
|
||||
class TestListDataModel(api_base.FunctionalTest):
|
||||
@@ -16,8 +16,8 @@ from oslo_serialization import jsonutils
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from watcher.common import utils
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestListGoal(api_base.FunctionalTest):
|
||||
@@ -13,7 +13,7 @@
|
||||
from http import HTTPStatus
|
||||
|
||||
from watcher.api.controllers.v1 import versions
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
|
||||
|
||||
SERVICE_TYPE = 'infra-optim'
|
||||
@@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
|
||||
|
||||
class TestV1Routing(api_base.FunctionalTest):
|
||||
@@ -15,8 +15,8 @@ from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
from watcher.common import utils
|
||||
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestListScoringEngine(api_base.FunctionalTest):
|
||||
@@ -15,8 +15,8 @@ from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestListService(api_base.FunctionalTest):
|
||||
@@ -19,8 +19,8 @@ from oslo_serialization import jsonutils
|
||||
|
||||
from watcher.common import utils
|
||||
from watcher.decision_engine import rpcapi as deapi
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestListStrategy(api_base.FunctionalTest):
|
||||
@@ -23,7 +23,7 @@ from http import HTTPStatus
|
||||
from watcher.api.controllers.v1 import types
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestUuidType(base.TestCase):
|
||||
@@ -18,7 +18,7 @@ import wsme
|
||||
from oslo_config import cfg
|
||||
|
||||
from watcher.api.controllers.v1 import utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -16,8 +16,8 @@ from http import HTTPStatus
|
||||
|
||||
from watcher.decision_engine import rpcapi as deapi
|
||||
from watcher import objects
|
||||
from watcher.tests.api import base as api_base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.api import base as api_base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestPost(api_base.FunctionalTest):
|
||||
@@ -24,8 +24,8 @@ from watcher.common import utils
|
||||
from watcher import notifications
|
||||
from watcher import objects
|
||||
from watcher.objects import action_plan as ap_objects
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestDefaultActionPlanHandler(base.DbTestCase):
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
from watcher.applier.actions import base as abase
|
||||
from watcher.applier.loading import default
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestDefaultActionLoader(base.TestCase):
|
||||
@@ -21,8 +21,8 @@ from watcher.applier.actions import base as baction
|
||||
from watcher.applier.actions import change_node_power_state
|
||||
from watcher.common.metal_helper import constants as m_constants
|
||||
from watcher.common.metal_helper import factory as m_helper_factory
|
||||
from watcher.tests import base
|
||||
from watcher.tests.decision_engine import fake_metal_helper
|
||||
from watcher.tests.unit import base
|
||||
from watcher.tests.unit.decision_engine import fake_metal_helper
|
||||
|
||||
COMPUTE_NODE = "compute-1"
|
||||
|
||||
@@ -22,7 +22,7 @@ from watcher.applier.actions import change_nova_service_state
|
||||
from watcher.common import clients
|
||||
from watcher.common import nova_helper
|
||||
from watcher.decision_engine.model import element
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestChangeNovaServiceState(base.TestCase):
|
||||
@@ -25,7 +25,7 @@ from watcher.applier.actions import migration
|
||||
from watcher.common import clients
|
||||
from watcher.common import exception
|
||||
from watcher.common import nova_helper
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestMigration(base.TestCase):
|
||||
@@ -19,7 +19,7 @@ from watcher.applier.actions import base as baction
|
||||
from watcher.applier.actions import resize
|
||||
from watcher.common import clients
|
||||
from watcher.common import nova_helper
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestResize(base.TestCase):
|
||||
@@ -18,7 +18,7 @@ import jsonschema
|
||||
from unittest import mock
|
||||
|
||||
from watcher.applier.actions import sleep
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestSleep(base.TestCase):
|
||||
@@ -23,7 +23,7 @@ from watcher.applier.actions import base as baction
|
||||
from watcher.applier.actions import stop
|
||||
from watcher.common import exception
|
||||
from watcher.common import nova_helper
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestStop(base.TestCase):
|
||||
@@ -22,7 +22,7 @@ from watcher.common import cinder_helper
|
||||
from watcher.common import clients
|
||||
from watcher.common import keystone_helper
|
||||
from watcher.common import nova_helper
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestMigration(base.TestCase):
|
||||
@@ -23,7 +23,7 @@ from unittest import mock
|
||||
from watcher.applier.messaging import trigger
|
||||
from watcher.common import utils
|
||||
from watcher import objects
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -21,7 +21,7 @@ from unittest import mock
|
||||
import oslo_messaging as om
|
||||
from watcher.applier import manager as applier_manager
|
||||
from watcher.common import service
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestApplierManager(base.TestCase):
|
||||
@@ -23,7 +23,7 @@ from watcher.applier import rpcapi
|
||||
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestApplierAPI(base.TestCase):
|
||||
@@ -22,11 +22,11 @@ from oslo_utils import uuidutils
|
||||
|
||||
from watcher.applier import sync
|
||||
from watcher.decision_engine.strategy.strategies import dummy_strategy
|
||||
from watcher.tests.db import base as db_base
|
||||
from watcher.tests.unit.db import base as db_base
|
||||
|
||||
from watcher import notifications
|
||||
from watcher import objects
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestCancelOngoingActionPlans(db_base.DbTestCase):
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
from watcher.applier.loading import default
|
||||
from watcher.applier.workflow_engine import base as wbase
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestDefaultActionLoader(base.TestCase):
|
||||
@@ -26,8 +26,8 @@ from watcher.common import exception
|
||||
from watcher.common import utils
|
||||
from watcher import notifications
|
||||
from watcher import objects
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class ExpectedException(Exception):
|
||||
@@ -24,8 +24,8 @@ from watcher.common import clients
|
||||
from watcher.common import nova_helper
|
||||
from watcher.common import utils
|
||||
from watcher import objects
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestTaskFlowActionContainer(base.DbTestCase):
|
||||
@@ -29,9 +29,9 @@ import testscenarios
|
||||
from watcher.common import context as watcher_context
|
||||
from watcher.common import service
|
||||
from watcher.objects import base as objects_base
|
||||
from watcher.tests import conf_fixture
|
||||
from watcher.tests.fixtures import conf_fixture
|
||||
from watcher.tests.fixtures import policy_fixture
|
||||
from watcher.tests.fixtures import watcher as watcher_fixtures
|
||||
from watcher.tests import policy_fixture
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
@@ -23,7 +23,7 @@ from pecan.testing import load_test_app
|
||||
from watcher.api import config as api_config
|
||||
from watcher.cmd.eventlet import api
|
||||
from watcher.common import service
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestApi(base.BaseTestCase):
|
||||
@@ -22,7 +22,7 @@ from oslo_service import service
|
||||
from watcher.applier import sync
|
||||
from watcher.cmd.eventlet import applier
|
||||
from watcher.common import service as watcher_service
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestApplier(base.BaseTestCase):
|
||||
@@ -21,7 +21,7 @@ from oslo_config import cfg
|
||||
from watcher.cmd import dbmanage
|
||||
from watcher.db import migration
|
||||
from watcher.db import purge
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestDBManageRunApp(base.TestCase):
|
||||
@@ -23,8 +23,8 @@ from watcher.cmd.eventlet import decisionengine
|
||||
from watcher.common import service as watcher_service
|
||||
from watcher.decision_engine.audit import continuous
|
||||
from watcher.decision_engine import sync
|
||||
from watcher.tests import base
|
||||
from watcher.tests.fixtures import watcher as watcher_fixtures
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestDecisionEngine(base.BaseTestCase):
|
||||
@@ -16,7 +16,7 @@ from oslo_upgradecheck.upgradecheck import Code
|
||||
|
||||
from watcher.cmd import status
|
||||
from watcher import conf
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
CONF = conf.CONF
|
||||
|
||||
@@ -22,7 +22,7 @@ from stevedore import extension as stevedore_extension
|
||||
from watcher.common import exception
|
||||
from watcher.common.loader import default
|
||||
from watcher.common.loader import loadable
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class FakeLoadable(loadable.Loadable):
|
||||
@@ -18,7 +18,7 @@ from unittest import mock
|
||||
from watcher.common import exception
|
||||
from watcher.common.metal_helper import base as m_helper_base
|
||||
from watcher.common.metal_helper import constants as m_constants
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
# The base classes have abstract methods, we'll need to
|
||||
@@ -19,7 +19,7 @@ from watcher.common import clients
|
||||
from watcher.common.metal_helper import factory
|
||||
from watcher.common.metal_helper import ironic
|
||||
from watcher.common.metal_helper import maas
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestMetalHelperFactory(base.TestCase):
|
||||
@@ -17,7 +17,7 @@ from unittest import mock
|
||||
|
||||
from watcher.common.metal_helper import constants as m_constants
|
||||
from watcher.common.metal_helper import ironic
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestIronicNode(base.TestCase):
|
||||
@@ -22,7 +22,7 @@ except ImportError:
|
||||
|
||||
from watcher.common.metal_helper import constants as m_constants
|
||||
from watcher.common.metal_helper import maas
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestMaasNode(base.TestCase):
|
||||
@@ -26,7 +26,7 @@ from watcher.common import cinder_helper
|
||||
from watcher.common import clients
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
@mock.patch.object(clients.OpenStackClients, 'cinder')
|
||||
@@ -31,7 +31,7 @@ from novaclient import client as nvclient
|
||||
|
||||
from watcher.common import clients
|
||||
from watcher import conf
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
CONF = conf.CONF
|
||||
|
||||
@@ -17,7 +17,7 @@ from unittest import mock
|
||||
|
||||
from watcher.common import executor
|
||||
from watcher import eventlet as eventlet_helper
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
@mock.patch.object(eventlet_helper, 'is_patched')
|
||||
@@ -22,7 +22,7 @@ from watcher.common import clients
|
||||
from watcher.common import exception
|
||||
from watcher.common import ironic_helper
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestIronicHelper(base.TestCase):
|
||||
@@ -18,8 +18,8 @@ from unittest import mock
|
||||
import keystoneclient.v3.services as ks_service
|
||||
|
||||
from watcher.common import keystone_helper
|
||||
from watcher.tests import base as test
|
||||
from watcher.tests.fixtures import watcher as watcher_fixtures
|
||||
from watcher.tests.unit import base as test
|
||||
|
||||
|
||||
class TestKeystoneHelper(test.TestCase):
|
||||
@@ -33,7 +33,7 @@ from watcher.common import exception
|
||||
from watcher.common import nova_helper
|
||||
from watcher.common import utils
|
||||
from watcher import conf
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
CONF = conf.CONF
|
||||
|
||||
@@ -18,7 +18,7 @@ from oslo_service import backend
|
||||
|
||||
from watcher.common import oslo_service_helper
|
||||
from watcher import eventlet as eventlet_helper
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestOsloServiceHelper(base.TestCase):
|
||||
@@ -14,15 +14,15 @@
|
||||
from http import HTTPStatus
|
||||
from unittest import mock
|
||||
|
||||
from watcher.common import placement_helper
|
||||
from watcher.tests import base
|
||||
from watcher.tests import fakes as fake_requests
|
||||
|
||||
from keystoneauth1 import loading as ka_loading
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from watcher.common import placement_helper
|
||||
from watcher.tests.fixtures import fakes as fake_requests
|
||||
from watcher.tests.unit import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from apscheduler.schedulers import background
|
||||
|
||||
from watcher.common import scheduling
|
||||
from watcher import eventlet as eventlet_helper
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestSchedulerMonkeyPatching(base.BaseTestCase):
|
||||
@@ -23,9 +23,9 @@ from oslo_utils import timeutils
|
||||
|
||||
from watcher.common import service
|
||||
from watcher import objects
|
||||
from watcher.tests import base
|
||||
from watcher.tests.db import base as db_base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit import base
|
||||
from watcher.tests.unit.db import base as db_base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -18,7 +18,7 @@ import time
|
||||
from unittest import mock
|
||||
|
||||
from watcher.common import utils
|
||||
from watcher.tests import base
|
||||
from watcher.tests.unit import base
|
||||
|
||||
|
||||
class TestCommonUtils(base.TestCase):
|
||||
@@ -21,8 +21,8 @@ from stevedore import extension
|
||||
|
||||
from watcher.conf import opts
|
||||
from watcher.conf import plugins
|
||||
from watcher.tests import base
|
||||
from watcher.tests.decision_engine import fake_strategies
|
||||
from watcher.tests.unit import base
|
||||
from watcher.tests.unit.decision_engine import fake_strategies
|
||||
|
||||
|
||||
class TestListOpts(base.TestCase):
|
||||
@@ -166,5 +166,5 @@ class TestPlugins(base.TestCase):
|
||||
plugins.show_plugins()
|
||||
m_show.assert_called_once_with(
|
||||
[('watcher_strategies.strategy_1', 'strategy_1',
|
||||
'watcher.tests.decision_engine.'
|
||||
'watcher.tests.unit.decision_engine.'
|
||||
'fake_strategies.FakeDummy1Strategy1')])
|
||||
@@ -22,8 +22,8 @@ from oslo_db.sqlalchemy import test_fixtures
|
||||
|
||||
from watcher.db import api as dbapi
|
||||
from watcher.db.sqlalchemy import migration
|
||||
from watcher.tests import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
@@ -20,8 +20,8 @@ import freezegun
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher import objects
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbActionFilters(base.DbTestCase):
|
||||
@@ -19,8 +19,8 @@
|
||||
import freezegun
|
||||
|
||||
from watcher.common import exception
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbActionDescriptionFilters(base.DbTestCase):
|
||||
@@ -20,8 +20,8 @@ import freezegun
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher.objects import action_plan as ap_objects
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbActionPlanFilters(base.DbTestCase):
|
||||
@@ -20,8 +20,8 @@ import freezegun
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher import objects
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbAuditFilters(base.DbTestCase):
|
||||
@@ -19,8 +19,8 @@ import freezegun
|
||||
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbAuditTemplateFilters(base.DbTestCase):
|
||||
@@ -20,8 +20,8 @@ import freezegun
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher import objects
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbEfficacyIndicatorFilters(base.DbTestCase):
|
||||
@@ -19,8 +19,8 @@ import freezegun
|
||||
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbGoalFilters(base.DbTestCase):
|
||||
@@ -36,8 +36,8 @@ import sqlalchemy
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher.db import api as dbapi
|
||||
from watcher.db.sqlalchemy import migration
|
||||
from watcher.tests import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -23,8 +23,8 @@ from watcher.common import context as watcher_context
|
||||
from watcher.common import utils
|
||||
from watcher.db import purge
|
||||
from watcher.db.sqlalchemy import api as dbapi
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestPurgeCommand(base.DbTestCase):
|
||||
@@ -20,8 +20,8 @@ import freezegun
|
||||
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbScoringEngineFilters(base.DbTestCase):
|
||||
@@ -21,8 +21,8 @@ import freezegun
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from watcher.common import exception
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbServiceFilters(base.DbTestCase):
|
||||
@@ -20,8 +20,8 @@ import freezegun
|
||||
|
||||
from watcher.common import exception
|
||||
from watcher.common import utils as w_utils
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.db import utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.db import utils
|
||||
|
||||
|
||||
class TestDbStrategyFilters(base.DbTestCase):
|
||||
@@ -33,9 +33,10 @@ from watcher.decision_engine.strategy.strategies import base as base_strategy
|
||||
from watcher.decision_engine.strategy.strategies import dummy_strategy
|
||||
from watcher import notifications
|
||||
from watcher import objects
|
||||
from watcher.tests.db import base
|
||||
from watcher.tests.decision_engine.model import faker_cluster_state as faker
|
||||
from watcher.tests.objects import utils as obj_utils
|
||||
from watcher.tests.unit.db import base
|
||||
from watcher.tests.unit.decision_engine.model import (
|
||||
faker_cluster_state as faker)
|
||||
from watcher.tests.unit.objects import utils as obj_utils
|
||||
|
||||
|
||||
class TestOneShotAuditHandler(base.DbTestCase):
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user