From 4f17759e794d2f07e7ae209f1f07f4e79733db1d Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Tue, 18 Nov 2025 09:54:13 +0100 Subject: [PATCH] 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 --- tox.ini | 8 +++-- watcher/tests/__init__.py | 36 ------------------- watcher/tests/{ => fixtures}/conf_fixture.py | 0 watcher/tests/{ => fixtures}/fake_policy.py | 0 watcher/tests/{ => fixtures}/fakes.py | 0 .../tests/{ => fixtures}/policy_fixture.py | 2 +- watcher/tests/unit/__init__.py | 36 +++++++++++++++++++ watcher/tests/{ => unit}/api/__init__.py | 0 watcher/tests/{ => unit}/api/base.py | 2 +- watcher/tests/{ => unit}/api/test_base.py | 2 +- watcher/tests/{ => unit}/api/test_config.py | 2 +- watcher/tests/{ => unit}/api/test_hooks.py | 2 +- watcher/tests/{ => unit}/api/test_root.py | 2 +- watcher/tests/{ => unit}/api/test_utils.py | 2 +- watcher/tests/{ => unit}/api/utils.py | 2 +- watcher/tests/{ => unit}/api/v1/__init__.py | 0 .../tests/{ => unit}/api/v1/test_actions.py | 10 +++--- .../{ => unit}/api/v1/test_actions_plans.py | 4 +-- .../{ => unit}/api/v1/test_audit_templates.py | 10 +++--- .../tests/{ => unit}/api/v1/test_audits.py | 10 +++--- .../{ => unit}/api/v1/test_data_model.py | 4 +-- watcher/tests/{ => unit}/api/v1/test_goals.py | 4 +-- .../{ => unit}/api/v1/test_microversions.py | 2 +- watcher/tests/{ => unit}/api/v1/test_root.py | 2 +- .../{ => unit}/api/v1/test_scoring_engines.py | 4 +-- .../tests/{ => unit}/api/v1/test_services.py | 4 +-- .../{ => unit}/api/v1/test_strategies.py | 4 +-- watcher/tests/{ => unit}/api/v1/test_types.py | 2 +- watcher/tests/{ => unit}/api/v1/test_utils.py | 2 +- .../tests/{ => unit}/api/v1/test_webhooks.py | 4 +-- watcher/tests/{ => unit}/applier/__init__.py | 0 .../applier/action_plan/__init__.py | 0 .../test_default_action_handler.py | 4 +-- .../{ => unit}/applier/actions/__init__.py | 0 .../applier/actions/loading/__init__.py | 0 .../loading/test_default_actions_loader.py | 2 +- .../actions/test_change_node_power_state.py | 4 +-- .../actions/test_change_nova_service_state.py | 2 +- .../applier/actions/test_migration.py | 2 +- .../{ => unit}/applier/actions/test_resize.py | 2 +- .../{ => unit}/applier/actions/test_sleep.py | 2 +- .../{ => unit}/applier/actions/test_stop.py | 2 +- .../applier/actions/test_volume_migration.py | 2 +- .../{ => unit}/applier/messaging/__init__.py | 0 .../test_trigger_action_plan_endpoint.py | 2 +- .../applier/test_applier_manager.py | 2 +- .../tests/{ => unit}/applier/test_rpcapi.py | 2 +- watcher/tests/{ => unit}/applier/test_sync.py | 4 +-- .../applier/workflow_engine/__init__.py | 0 .../workflow_engine/loading/__init__.py | 0 .../loading/test_default_engine_loader.py | 2 +- .../test_default_workflow_engine.py | 4 +-- .../test_taskflow_action_container.py | 4 +-- watcher/tests/{ => unit}/base.py | 4 +-- watcher/tests/{ => unit}/cmd/__init__.py | 0 watcher/tests/{ => unit}/cmd/test_api.py | 2 +- watcher/tests/{ => unit}/cmd/test_applier.py | 2 +- .../tests/{ => unit}/cmd/test_db_manage.py | 2 +- .../{ => unit}/cmd/test_decision_engine.py | 2 +- watcher/tests/{ => unit}/cmd/test_status.py | 2 +- watcher/tests/{ => unit}/common/__init__.py | 0 .../{ => unit}/common/loader/__init__.py | 0 .../{ => unit}/common/loader/test_loader.py | 2 +- .../common/metal_helper/__init__.py | 0 .../common/metal_helper/test_base.py | 2 +- .../common/metal_helper/test_factory.py | 2 +- .../common/metal_helper/test_ironic.py | 2 +- .../common/metal_helper/test_maas.py | 2 +- .../{ => unit}/common/test_cinder_helper.py | 2 +- .../tests/{ => unit}/common/test_clients.py | 2 +- .../tests/{ => unit}/common/test_executor.py | 2 +- .../{ => unit}/common/test_ironic_helper.py | 2 +- .../{ => unit}/common/test_keystone_helper.py | 2 +- .../{ => unit}/common/test_nova_helper.py | 2 +- .../common/test_oslo_service_helper.py | 2 +- .../common/test_placement_helper.py | 8 ++--- .../{ => unit}/common/test_scheduling.py | 2 +- .../tests/{ => unit}/common/test_service.py | 6 ++-- watcher/tests/{ => unit}/common/test_utils.py | 2 +- watcher/tests/{ => unit}/conf/__init__.py | 0 .../tests/{ => unit}/conf/test_list_opts.py | 6 ++-- watcher/tests/{ => unit}/config.py | 0 watcher/tests/{ => unit}/db/__init__.py | 0 watcher/tests/{ => unit}/db/base.py | 4 +-- watcher/tests/{ => unit}/db/test_action.py | 4 +-- .../{ => unit}/db/test_action_description.py | 4 +-- .../tests/{ => unit}/db/test_action_plan.py | 4 +-- watcher/tests/{ => unit}/db/test_audit.py | 4 +-- .../{ => unit}/db/test_audit_template.py | 4 +-- .../{ => unit}/db/test_efficacy_indicator.py | 4 +-- watcher/tests/{ => unit}/db/test_goal.py | 4 +-- .../tests/{ => unit}/db/test_migrations.py | 4 +-- watcher/tests/{ => unit}/db/test_purge.py | 4 +-- .../{ => unit}/db/test_scoring_engine.py | 4 +-- watcher/tests/{ => unit}/db/test_service.py | 4 +-- watcher/tests/{ => unit}/db/test_strategy.py | 4 +-- watcher/tests/{ => unit}/db/utils.py | 0 .../{ => unit}/decision_engine/__init__.py | 0 .../decision_engine/audit/__init__.py | 0 .../audit/test_audit_handlers.py | 7 ++-- .../decision_engine/cluster/__init__.py | 0 .../cluster/test_cinder_cdmc.py | 4 +-- .../test_cluster_data_model_collector.py | 2 +- .../decision_engine/cluster/test_nova_cdmc.py | 4 +-- .../decision_engine/datasources/__init__.py | 0 .../grafana_translators/__init__.py | 0 .../grafana_translators/test_base.py | 2 +- .../grafana_translators/test_influxdb.py | 4 +-- .../datasources/test_aetos_helper.py | 2 +- .../decision_engine/datasources/test_base.py | 2 +- .../datasources/test_gnocchi_helper.py | 2 +- .../datasources/test_grafana_helper.py | 2 +- .../datasources/test_manager.py | 2 +- .../datasources/test_monasca_helper.py | 2 +- .../datasources/test_prometheus_base.py | 2 +- .../datasources/test_prometheus_helper.py | 2 +- .../event_consumer/__init__.py | 0 .../{ => unit}/decision_engine/fake_goals.py | 0 .../decision_engine/fake_metal_helper.py | 0 .../decision_engine/fake_strategies.py | 0 .../decision_engine/loading/__init__.py | 0 .../loading/test_collector_loader.py | 6 ++-- .../loading/test_default_planner_loader.py | 2 +- .../loading/test_default_strategy_loader.py | 2 +- .../loading/test_goal_loader.py | 2 +- .../decision_engine/messaging/__init__.py | 0 .../messaging/test_audit_endpoint.py | 6 ++-- .../messaging/test_data_model_endpoint.py | 0 .../decision_engine/model/__init__.py | 0 .../model/data/ironic_scenario_1.xml | 0 .../decision_engine/model/data/scenario_1.xml | 0 .../model/data/scenario_10.xml | 0 .../scenario_11_with_1_node_no_instance.xml | 0 .../scenario_11_with_2_nodes_2_instances.xml | 0 .../scenario_1_with_1_node_unavailable.xml | 0 .../scenario_1_with_all_instances_exclude.xml | 0 .../scenario_1_with_all_nodes_disable.xml | 0 .../model/data/scenario_1_with_metrics.xml | 0 .../model/data/scenario_2_with_metrics.xml | 0 .../model/data/scenario_3_with_2_nodes.xml | 0 .../model/data/scenario_3_with_metrics.xml | 0 .../scenario_4_with_1_node_no_instance.xml | 0 .../data/scenario_5_with_instance_disk_0.xml | 0 .../model/data/scenario_6_with_2_nodes.xml | 0 .../model/data/scenario_7_with_2_nodes.xml | 0 .../model/data/scenario_8_with_4_nodes.xml | 0 ..._9_with_3_active_plus_1_disabled_nodes.xml | 0 .../model/data/storage_scenario_1.xml | 0 .../model/faker_cluster_and_metrics.py | 0 .../model/faker_cluster_state.py | 0 .../decision_engine/model/gnocchi_metrics.py | 0 .../decision_engine/model/monasca_metrics.py | 0 .../model/notification/__init__.py | 0 .../model/notification/data/capacity.json | 0 .../data/instance-create-end.json | 0 .../data/instance-delete-end.json | 0 ...nce-live_migration_force_complete-end.json | 0 .../instance-live_migration_post-end.json | 0 .../notification/data/instance-lock.json | 0 .../notification/data/instance-pause-end.json | 0 .../data/instance-power_off-end.json | 0 .../data/instance-power_on-end.json | 0 .../data/instance-rebuild-end.json | 0 .../data/instance-rescue-end.json | 0 .../data/instance-resize_confirm-end.json | 0 .../data/instance-restore-end.json | 0 .../data/instance-resume-end.json | 0 .../data/instance-shelve-end.json | 0 .../data/instance-shutdown-end.json | 0 .../data/instance-soft_delete-end.json | 0 .../data/instance-suspend-end.json | 0 .../notification/data/instance-unlock.json | 0 .../data/instance-unpause-end.json | 0 .../data/instance-unrescue-end.json | 0 .../data/instance-unshelve-end.json | 0 .../data/instance-update-2-1.json | 0 .../notification/data/instance-update.json | 0 .../data/scenario3_instance-update.json | 0 .../scenario3_notfound_instance-update.json | 0 ...ario3_notfound_legacy_instance-update.json | 0 .../scenario3_service-update-disabled.json | 0 .../scenario3_service-update-enabled.json | 0 .../scenario_1_bootable-volume-create.json | 0 .../data/scenario_1_capacity.json | 0 .../scenario_1_capacity_node_notfound.json | 0 .../scenario_1_capacity_pool_notfound.json | 0 .../data/scenario_1_error-volume-create.json | 0 .../data/scenario_1_volume-attach.json | 0 .../data/scenario_1_volume-create.json | 0 ...cenario_1_volume-create_pool_notfound.json | 0 .../data/scenario_1_volume-delete.json | 0 .../data/scenario_1_volume-detach.json | 0 .../data/scenario_1_volume-resize.json | 0 .../data/scenario_1_volume-update.json | 0 .../notification/data/service-create.json | 0 .../notification/data/service-delete.json | 0 .../notification/data/service-update.json | 0 .../model/notification/fake_managers.py | 2 +- .../notification/test_cinder_notifications.py | 8 ++--- .../model/notification/test_notifications.py | 4 +-- .../notification/test_nova_notifications.py | 6 ++-- .../decision_engine/model/test_element.py | 2 +- .../decision_engine/model/test_model.py | 4 +-- .../decision_engine/planner/__init__.py | 0 .../test_node_resource_consolidation.py | 6 ++-- .../planner/test_planner_manager.py | 2 +- .../planner/test_weight_planner.py | 10 +++--- .../test_workload_stabilization_planner.py | 10 +++--- .../decision_engine/scope/__init__.py | 0 .../decision_engine/scope/fake_scopes.py | 2 +- .../decision_engine/scope/test_baremetal.py | 6 ++-- .../decision_engine/scope/test_compute.py | 6 ++-- .../decision_engine/scope/test_storage.py | 6 ++-- .../decision_engine/scoring/__init__.py | 0 .../scoring/test_dummy_scorer.py | 2 +- .../scoring/test_dummy_scoring_container.py | 2 +- .../scoring/test_scoring_factory.py | 2 +- .../decision_engine/solution/__init__.py | 0 .../solution/test_default_solution.py | 2 +- .../decision_engine/strategy/__init__.py | 0 .../strategy/context/__init__.py | 0 .../strategy/context/test_strategy_context.py | 6 ++-- .../strategy/selector/__init__.py | 0 .../selector/test_strategy_selector.py | 2 +- .../strategy/strategies/__init__.py | 0 .../strategy/strategies/test_actuator.py | 2 +- .../strategy/strategies/test_base.py | 4 +-- .../strategies/test_basic_consolidation.py | 6 ++-- .../strategies/test_dummy_strategy.py | 2 +- .../strategies/test_dummy_with_scorer.py | 2 +- .../strategies/test_host_maintenance.py | 2 +- .../test_node_resource_consolidation.py | 4 +-- .../strategies/test_noisy_neighbor.py | 4 +-- .../strategies/test_outlet_temp_control.py | 4 +-- .../strategy/strategies/test_saving_energy.py | 4 +-- .../test_storage_capacity_balance.py | 4 +-- .../strategies/test_strategy_endpoint.py | 2 +- .../strategies/test_uniform_airflow.py | 4 +-- .../test_vm_workload_consolidation.py | 4 +-- .../strategies/test_workload_balance.py | 4 +-- .../strategies/test_workload_stabilization.py | 4 +-- .../strategies/test_zone_migration.py | 4 +-- .../{ => unit}/decision_engine/test_gmr.py | 2 +- .../{ => unit}/decision_engine/test_rpcapi.py | 2 +- .../decision_engine/test_scheduling.py | 8 ++--- .../decision_engine/test_service.py | 2 +- .../decision_engine/test_service_monitor.py | 6 ++-- .../{ => unit}/decision_engine/test_sync.py | 6 ++-- .../{ => unit}/notifications/__init__.py | 0 .../notifications/test_action_notification.py | 8 ++--- .../test_action_plan_notification.py | 10 +++--- .../notifications/test_audit_notification.py | 7 ++-- .../notifications/test_notification.py | 4 +-- .../test_service_notifications.py | 4 +-- watcher/tests/{ => unit}/objects/__init__.py | 0 .../tests/{ => unit}/objects/test_action.py | 4 +-- .../objects/test_action_description.py | 4 +-- .../{ => unit}/objects/test_action_plan.py | 4 +-- .../tests/{ => unit}/objects/test_audit.py | 6 ++-- .../{ => unit}/objects/test_audit_template.py | 4 +-- .../objects/test_efficacy_indicator.py | 4 +-- watcher/tests/{ => unit}/objects/test_goal.py | 4 +-- .../tests/{ => unit}/objects/test_objects.py | 2 +- .../{ => unit}/objects/test_scoring_engine.py | 4 +-- .../tests/{ => unit}/objects/test_service.py | 4 +-- .../tests/{ => unit}/objects/test_strategy.py | 4 +-- watcher/tests/{ => unit}/objects/utils.py | 2 +- watcher/tests/{ => unit}/test_threading.py | 2 +- 268 files changed, 320 insertions(+), 312 deletions(-) rename watcher/tests/{ => fixtures}/conf_fixture.py (100%) rename watcher/tests/{ => fixtures}/fake_policy.py (100%) rename watcher/tests/{ => fixtures}/fakes.py (100%) rename watcher/tests/{ => fixtures}/policy_fixture.py (97%) create mode 100644 watcher/tests/unit/__init__.py rename watcher/tests/{ => unit}/api/__init__.py (100%) rename watcher/tests/{ => unit}/api/base.py (99%) rename watcher/tests/{ => unit}/api/test_base.py (96%) rename watcher/tests/{ => unit}/api/test_config.py (97%) rename watcher/tests/{ => unit}/api/test_hooks.py (99%) rename watcher/tests/{ => unit}/api/test_root.py (98%) rename watcher/tests/{ => unit}/api/test_utils.py (98%) rename watcher/tests/{ => unit}/api/utils.py (98%) rename watcher/tests/{ => unit}/api/v1/__init__.py (100%) rename watcher/tests/{ => unit}/api/v1/test_actions.py (99%) rename watcher/tests/{ => unit}/api/v1/test_actions_plans.py (99%) rename watcher/tests/{ => unit}/api/v1/test_audit_templates.py (99%) rename watcher/tests/{ => unit}/api/v1/test_audits.py (99%) rename watcher/tests/{ => unit}/api/v1/test_data_model.py (98%) rename watcher/tests/{ => unit}/api/v1/test_goals.py (98%) rename watcher/tests/{ => unit}/api/v1/test_microversions.py (98%) rename watcher/tests/{ => unit}/api/v1/test_root.py (92%) rename watcher/tests/{ => unit}/api/v1/test_scoring_engines.py (98%) rename watcher/tests/{ => unit}/api/v1/test_services.py (98%) rename watcher/tests/{ => unit}/api/v1/test_strategies.py (99%) rename watcher/tests/{ => unit}/api/v1/test_types.py (99%) rename watcher/tests/{ => unit}/api/v1/test_utils.py (98%) rename watcher/tests/{ => unit}/api/v1/test_webhooks.py (96%) rename watcher/tests/{ => unit}/applier/__init__.py (100%) rename watcher/tests/{ => unit}/applier/action_plan/__init__.py (100%) rename watcher/tests/{ => unit}/applier/action_plan/test_default_action_handler.py (99%) rename watcher/tests/{ => unit}/applier/actions/__init__.py (100%) rename watcher/tests/{ => unit}/applier/actions/loading/__init__.py (100%) rename watcher/tests/{ => unit}/applier/actions/loading/test_default_actions_loader.py (96%) rename watcher/tests/{ => unit}/applier/actions/test_change_node_power_state.py (98%) rename watcher/tests/{ => unit}/applier/actions/test_change_nova_service_state.py (99%) rename watcher/tests/{ => unit}/applier/actions/test_migration.py (99%) rename watcher/tests/{ => unit}/applier/actions/test_resize.py (98%) rename watcher/tests/{ => unit}/applier/actions/test_sleep.py (97%) rename watcher/tests/{ => unit}/applier/actions/test_stop.py (99%) rename watcher/tests/{ => unit}/applier/actions/test_volume_migration.py (99%) rename watcher/tests/{ => unit}/applier/messaging/__init__.py (100%) rename watcher/tests/{ => unit}/applier/messaging/test_trigger_action_plan_endpoint.py (98%) rename watcher/tests/{ => unit}/applier/test_applier_manager.py (97%) rename watcher/tests/{ => unit}/applier/test_rpcapi.py (98%) rename watcher/tests/{ => unit}/applier/test_sync.py (96%) rename watcher/tests/{ => unit}/applier/workflow_engine/__init__.py (100%) rename watcher/tests/{ => unit}/applier/workflow_engine/loading/__init__.py (100%) rename watcher/tests/{ => unit}/applier/workflow_engine/loading/test_default_engine_loader.py (96%) rename watcher/tests/{ => unit}/applier/workflow_engine/test_default_workflow_engine.py (99%) rename watcher/tests/{ => unit}/applier/workflow_engine/test_taskflow_action_container.py (99%) rename watcher/tests/{ => unit}/base.py (98%) rename watcher/tests/{ => unit}/cmd/__init__.py (100%) rename watcher/tests/{ => unit}/cmd/test_api.py (98%) rename watcher/tests/{ => unit}/cmd/test_applier.py (97%) rename watcher/tests/{ => unit}/cmd/test_db_manage.py (99%) rename watcher/tests/{ => unit}/cmd/test_decision_engine.py (98%) rename watcher/tests/{ => unit}/cmd/test_status.py (97%) rename watcher/tests/{ => unit}/common/__init__.py (100%) rename watcher/tests/{ => unit}/common/loader/__init__.py (100%) rename watcher/tests/{ => unit}/common/loader/test_loader.py (98%) rename watcher/tests/{ => unit}/common/metal_helper/__init__.py (100%) rename watcher/tests/{ => unit}/common/metal_helper/test_base.py (98%) rename watcher/tests/{ => unit}/common/metal_helper/test_factory.py (97%) rename watcher/tests/{ => unit}/common/metal_helper/test_ironic.py (99%) rename watcher/tests/{ => unit}/common/metal_helper/test_maas.py (99%) rename watcher/tests/{ => unit}/common/test_cinder_helper.py (99%) rename watcher/tests/{ => unit}/common/test_clients.py (99%) rename watcher/tests/{ => unit}/common/test_executor.py (98%) rename watcher/tests/{ => unit}/common/test_ironic_helper.py (98%) rename watcher/tests/{ => unit}/common/test_keystone_helper.py (98%) rename watcher/tests/{ => unit}/common/test_nova_helper.py (99%) rename watcher/tests/{ => unit}/common/test_oslo_service_helper.py (97%) rename watcher/tests/{ => unit}/common/test_placement_helper.py (99%) rename watcher/tests/{ => unit}/common/test_scheduling.py (98%) rename watcher/tests/{ => unit}/common/test_service.py (99%) rename watcher/tests/{ => unit}/common/test_utils.py (97%) rename watcher/tests/{ => unit}/conf/__init__.py (100%) rename watcher/tests/{ => unit}/conf/test_list_opts.py (97%) rename watcher/tests/{ => unit}/config.py (100%) rename watcher/tests/{ => unit}/db/__init__.py (100%) rename watcher/tests/{ => unit}/db/base.py (97%) rename watcher/tests/{ => unit}/db/test_action.py (99%) rename watcher/tests/{ => unit}/db/test_action_description.py (99%) rename watcher/tests/{ => unit}/db/test_action_plan.py (99%) rename watcher/tests/{ => unit}/db/test_audit.py (99%) rename watcher/tests/{ => unit}/db/test_audit_template.py (99%) rename watcher/tests/{ => unit}/db/test_efficacy_indicator.py (99%) rename watcher/tests/{ => unit}/db/test_goal.py (99%) rename watcher/tests/{ => unit}/db/test_migrations.py (99%) rename watcher/tests/{ => unit}/db/test_purge.py (99%) rename watcher/tests/{ => unit}/db/test_scoring_engine.py (99%) rename watcher/tests/{ => unit}/db/test_service.py (99%) rename watcher/tests/{ => unit}/db/test_strategy.py (99%) rename watcher/tests/{ => unit}/db/utils.py (100%) rename watcher/tests/{ => unit}/decision_engine/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/audit/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/audit/test_audit_handlers.py (99%) rename watcher/tests/{ => unit}/decision_engine/cluster/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/cluster/test_cinder_cdmc.py (98%) rename watcher/tests/{ => unit}/decision_engine/cluster/test_cluster_data_model_collector.py (98%) rename watcher/tests/{ => unit}/decision_engine/cluster/test_nova_cdmc.py (99%) rename watcher/tests/{ => unit}/decision_engine/datasources/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/datasources/grafana_translators/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/datasources/grafana_translators/test_base.py (99%) rename watcher/tests/{ => unit}/decision_engine/datasources/grafana_translators/test_influxdb.py (98%) rename watcher/tests/{ => unit}/decision_engine/datasources/test_aetos_helper.py (98%) rename watcher/tests/{ => unit}/decision_engine/datasources/test_base.py (98%) rename watcher/tests/{ => unit}/decision_engine/datasources/test_gnocchi_helper.py (99%) rename watcher/tests/{ => unit}/decision_engine/datasources/test_grafana_helper.py (99%) rename watcher/tests/{ => unit}/decision_engine/datasources/test_manager.py (99%) rename watcher/tests/{ => unit}/decision_engine/datasources/test_monasca_helper.py (99%) rename watcher/tests/{ => unit}/decision_engine/datasources/test_prometheus_base.py (99%) rename watcher/tests/{ => unit}/decision_engine/datasources/test_prometheus_helper.py (99%) rename watcher/tests/{ => unit}/decision_engine/event_consumer/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/fake_goals.py (100%) rename watcher/tests/{ => unit}/decision_engine/fake_metal_helper.py (100%) rename watcher/tests/{ => unit}/decision_engine/fake_strategies.py (100%) rename watcher/tests/{ => unit}/decision_engine/loading/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/loading/test_collector_loader.py (94%) rename watcher/tests/{ => unit}/decision_engine/loading/test_default_planner_loader.py (96%) rename watcher/tests/{ => unit}/decision_engine/loading/test_default_strategy_loader.py (98%) rename watcher/tests/{ => unit}/decision_engine/loading/test_goal_loader.py (98%) rename watcher/tests/{ => unit}/decision_engine/messaging/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/messaging/test_audit_endpoint.py (94%) rename watcher/tests/{ => unit}/decision_engine/messaging/test_data_model_endpoint.py (100%) rename watcher/tests/{ => unit}/decision_engine/model/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/ironic_scenario_1.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_1.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_10.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_11_with_1_node_no_instance.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_11_with_2_nodes_2_instances.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_1_with_1_node_unavailable.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_1_with_all_instances_exclude.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_1_with_metrics.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_2_with_metrics.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_3_with_2_nodes.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_3_with_metrics.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_4_with_1_node_no_instance.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_5_with_instance_disk_0.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_6_with_2_nodes.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_7_with_2_nodes.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_8_with_4_nodes.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/data/storage_scenario_1.xml (100%) rename watcher/tests/{ => unit}/decision_engine/model/faker_cluster_and_metrics.py (100%) rename watcher/tests/{ => unit}/decision_engine/model/faker_cluster_state.py (100%) rename watcher/tests/{ => unit}/decision_engine/model/gnocchi_metrics.py (100%) rename watcher/tests/{ => unit}/decision_engine/model/monasca_metrics.py (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/capacity.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-create-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-delete-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-live_migration_force_complete-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-live_migration_post-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-lock.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-pause-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-power_off-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-power_on-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-rebuild-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-rescue-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-resize_confirm-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-restore-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-resume-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-shelve-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-shutdown-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-soft_delete-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-suspend-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-unlock.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-unpause-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-unrescue-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-unshelve-end.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-update-2-1.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/instance-update.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario3_instance-update.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario3_notfound_instance-update.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario3_notfound_legacy_instance-update.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario3_service-update-disabled.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario3_service-update-enabled.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_bootable-volume-create.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_capacity.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_capacity_node_notfound.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_capacity_pool_notfound.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_error-volume-create.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_volume-attach.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_volume-create.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_volume-create_pool_notfound.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_volume-delete.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_volume-detach.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_volume-resize.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/scenario_1_volume-update.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/service-create.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/service-delete.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/data/service-update.json (100%) rename watcher/tests/{ => unit}/decision_engine/model/notification/fake_managers.py (96%) rename watcher/tests/{ => unit}/decision_engine/model/notification/test_cinder_notifications.py (99%) rename watcher/tests/{ => unit}/decision_engine/model/notification/test_notifications.py (96%) rename watcher/tests/{ => unit}/decision_engine/model/notification/test_nova_notifications.py (99%) rename watcher/tests/{ => unit}/decision_engine/model/test_element.py (99%) rename watcher/tests/{ => unit}/decision_engine/model/test_model.py (99%) rename watcher/tests/{ => unit}/decision_engine/planner/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/planner/test_node_resource_consolidation.py (98%) rename watcher/tests/{ => unit}/decision_engine/planner/test_planner_manager.py (96%) rename watcher/tests/{ => unit}/decision_engine/planner/test_weight_planner.py (99%) rename watcher/tests/{ => unit}/decision_engine/planner/test_workload_stabilization_planner.py (98%) rename watcher/tests/{ => unit}/decision_engine/scope/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/scope/fake_scopes.py (97%) rename watcher/tests/{ => unit}/decision_engine/scope/test_baremetal.py (92%) rename watcher/tests/{ => unit}/decision_engine/scope/test_compute.py (98%) rename watcher/tests/{ => unit}/decision_engine/scope/test_storage.py (98%) rename watcher/tests/{ => unit}/decision_engine/scoring/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/scoring/test_dummy_scorer.py (98%) rename watcher/tests/{ => unit}/decision_engine/scoring/test_dummy_scoring_container.py (98%) rename watcher/tests/{ => unit}/decision_engine/scoring/test_scoring_factory.py (98%) rename watcher/tests/{ => unit}/decision_engine/solution/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/solution/test_default_solution.py (98%) rename watcher/tests/{ => unit}/decision_engine/strategy/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/strategy/context/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/strategy/context/test_strategy_context.py (95%) rename watcher/tests/{ => unit}/decision_engine/strategy/selector/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/strategy/selector/test_strategy_selector.py (98%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/__init__.py (100%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_actuator.py (94%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_base.py (98%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_basic_consolidation.py (97%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_dummy_strategy.py (96%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_dummy_with_scorer.py (96%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_host_maintenance.py (99%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_node_resource_consolidation.py (99%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_noisy_neighbor.py (97%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_outlet_temp_control.py (96%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_saving_energy.py (97%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_storage_capacity_balance.py (98%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_strategy_endpoint.py (98%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_uniform_airflow.py (98%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_vm_workload_consolidation.py (99%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_workload_balance.py (98%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_workload_stabilization.py (99%) rename watcher/tests/{ => unit}/decision_engine/strategy/strategies/test_zone_migration.py (99%) rename watcher/tests/{ => unit}/decision_engine/test_gmr.py (97%) rename watcher/tests/{ => unit}/decision_engine/test_rpcapi.py (98%) rename watcher/tests/{ => unit}/decision_engine/test_scheduling.py (96%) rename watcher/tests/{ => unit}/decision_engine/test_service.py (99%) rename watcher/tests/{ => unit}/decision_engine/test_service_monitor.py (99%) rename watcher/tests/{ => unit}/decision_engine/test_sync.py (99%) rename watcher/tests/{ => unit}/notifications/__init__.py (100%) rename watcher/tests/{ => unit}/notifications/test_action_notification.py (99%) rename watcher/tests/{ => unit}/notifications/test_action_plan_notification.py (98%) rename watcher/tests/{ => unit}/notifications/test_audit_notification.py (99%) rename watcher/tests/{ => unit}/notifications/test_notification.py (99%) rename watcher/tests/{ => unit}/notifications/test_service_notifications.py (97%) rename watcher/tests/{ => unit}/objects/__init__.py (100%) rename watcher/tests/{ => unit}/objects/test_action.py (99%) rename watcher/tests/{ => unit}/objects/test_action_description.py (98%) rename watcher/tests/{ => unit}/objects/test_action_plan.py (99%) rename watcher/tests/{ => unit}/objects/test_audit.py (99%) rename watcher/tests/{ => unit}/objects/test_audit_template.py (99%) rename watcher/tests/{ => unit}/objects/test_efficacy_indicator.py (98%) rename watcher/tests/{ => unit}/objects/test_goal.py (98%) rename watcher/tests/{ => unit}/objects/test_objects.py (99%) rename watcher/tests/{ => unit}/objects/test_scoring_engine.py (98%) rename watcher/tests/{ => unit}/objects/test_service.py (98%) rename watcher/tests/{ => unit}/objects/test_strategy.py (98%) rename watcher/tests/{ => unit}/objects/utils.py (99%) rename watcher/tests/{ => unit}/test_threading.py (99%) diff --git a/tox.ini b/tox.ini index a6d9b251d..f4bc03cfc 100644 --- a/tox.ini +++ b/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. diff --git a/watcher/tests/__init__.py b/watcher/tests/__init__.py index a6c535ab4..e69de29bb 100644 --- a/watcher/tests/__init__.py +++ b/watcher/tests/__init__.py @@ -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() diff --git a/watcher/tests/conf_fixture.py b/watcher/tests/fixtures/conf_fixture.py similarity index 100% rename from watcher/tests/conf_fixture.py rename to watcher/tests/fixtures/conf_fixture.py diff --git a/watcher/tests/fake_policy.py b/watcher/tests/fixtures/fake_policy.py similarity index 100% rename from watcher/tests/fake_policy.py rename to watcher/tests/fixtures/fake_policy.py diff --git a/watcher/tests/fakes.py b/watcher/tests/fixtures/fakes.py similarity index 100% rename from watcher/tests/fakes.py rename to watcher/tests/fixtures/fakes.py diff --git a/watcher/tests/policy_fixture.py b/watcher/tests/fixtures/policy_fixture.py similarity index 97% rename from watcher/tests/policy_fixture.py rename to watcher/tests/fixtures/policy_fixture.py index 25faf89cb..e69672648 100644 --- a/watcher/tests/policy_fixture.py +++ b/watcher/tests/fixtures/policy_fixture.py @@ -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 diff --git a/watcher/tests/unit/__init__.py b/watcher/tests/unit/__init__.py new file mode 100644 index 000000000..a6c535ab4 --- /dev/null +++ b/watcher/tests/unit/__init__.py @@ -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() diff --git a/watcher/tests/api/__init__.py b/watcher/tests/unit/api/__init__.py similarity index 100% rename from watcher/tests/api/__init__.py rename to watcher/tests/unit/api/__init__.py diff --git a/watcher/tests/api/base.py b/watcher/tests/unit/api/base.py similarity index 99% rename from watcher/tests/api/base.py rename to watcher/tests/unit/api/base.py index 0378b2a5a..c5ce27872 100644 --- a/watcher/tests/api/base.py +++ b/watcher/tests/unit/api/base.py @@ -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' diff --git a/watcher/tests/api/test_base.py b/watcher/tests/unit/api/test_base.py similarity index 96% rename from watcher/tests/api/test_base.py rename to watcher/tests/unit/api/test_base.py index c639cd092..161b650f1 100644 --- a/watcher/tests/api/test_base.py +++ b/watcher/tests/unit/api/test_base.py @@ -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): diff --git a/watcher/tests/api/test_config.py b/watcher/tests/unit/api/test_config.py similarity index 97% rename from watcher/tests/api/test_config.py rename to watcher/tests/unit/api/test_config.py index da29b075b..dd2684351 100644 --- a/watcher/tests/api/test_config.py +++ b/watcher/tests/unit/api/test_config.py @@ -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): diff --git a/watcher/tests/api/test_hooks.py b/watcher/tests/unit/api/test_hooks.py similarity index 99% rename from watcher/tests/api/test_hooks.py rename to watcher/tests/unit/api/test_hooks.py index bf0171a82..28826f5d6 100644 --- a/watcher/tests/api/test_hooks.py +++ b/watcher/tests/unit/api/test_hooks.py @@ -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: diff --git a/watcher/tests/api/test_root.py b/watcher/tests/unit/api/test_root.py similarity index 98% rename from watcher/tests/api/test_root.py rename to watcher/tests/unit/api/test_root.py index e95defd1d..c0c0a2328 100644 --- a/watcher/tests/api/test_root.py +++ b/watcher/tests/unit/api/test_root.py @@ -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): diff --git a/watcher/tests/api/test_utils.py b/watcher/tests/unit/api/test_utils.py similarity index 98% rename from watcher/tests/api/test_utils.py rename to watcher/tests/unit/api/test_utils.py index 17dd96a63..d75c77e25 100644 --- a/watcher/tests/api/test_utils.py +++ b/watcher/tests/unit/api/test_utils.py @@ -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): diff --git a/watcher/tests/api/utils.py b/watcher/tests/unit/api/utils.py similarity index 98% rename from watcher/tests/api/utils.py rename to watcher/tests/unit/api/utils.py index e0347a104..069146e19 100644 --- a/watcher/tests/api/utils.py +++ b/watcher/tests/unit/api/utils.py @@ -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' diff --git a/watcher/tests/api/v1/__init__.py b/watcher/tests/unit/api/v1/__init__.py similarity index 100% rename from watcher/tests/api/v1/__init__.py rename to watcher/tests/unit/api/v1/__init__.py diff --git a/watcher/tests/api/v1/test_actions.py b/watcher/tests/unit/api/v1/test_actions.py similarity index 99% rename from watcher/tests/api/v1/test_actions.py rename to watcher/tests/unit/api/v1/test_actions.py index 6ba2637f7..652b7c770 100644 --- a/watcher/tests/api/v1/test_actions.py +++ b/watcher/tests/unit/api/v1/test_actions.py @@ -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): diff --git a/watcher/tests/api/v1/test_actions_plans.py b/watcher/tests/unit/api/v1/test_actions_plans.py similarity index 99% rename from watcher/tests/api/v1/test_actions_plans.py rename to watcher/tests/unit/api/v1/test_actions_plans.py index 3328b7c2c..b1830e9ec 100644 --- a/watcher/tests/api/v1/test_actions_plans.py +++ b/watcher/tests/unit/api/v1/test_actions_plans.py @@ -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): diff --git a/watcher/tests/api/v1/test_audit_templates.py b/watcher/tests/unit/api/v1/test_audit_templates.py similarity index 99% rename from watcher/tests/api/v1/test_audit_templates.py rename to watcher/tests/unit/api/v1/test_audit_templates.py index 14841bc19..1dece493c 100644 --- a/watcher/tests/api/v1/test_audit_templates.py +++ b/watcher/tests/unit/api/v1/test_audit_templates.py @@ -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): diff --git a/watcher/tests/api/v1/test_audits.py b/watcher/tests/unit/api/v1/test_audits.py similarity index 99% rename from watcher/tests/api/v1/test_audits.py rename to watcher/tests/unit/api/v1/test_audits.py index 487da1e47..ea0015947 100644 --- a/watcher/tests/api/v1/test_audits.py +++ b/watcher/tests/unit/api/v1/test_audits.py @@ -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): diff --git a/watcher/tests/api/v1/test_data_model.py b/watcher/tests/unit/api/v1/test_data_model.py similarity index 98% rename from watcher/tests/api/v1/test_data_model.py rename to watcher/tests/unit/api/v1/test_data_model.py index ce888ec31..5934f6b87 100644 --- a/watcher/tests/api/v1/test_data_model.py +++ b/watcher/tests/unit/api/v1/test_data_model.py @@ -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): diff --git a/watcher/tests/api/v1/test_goals.py b/watcher/tests/unit/api/v1/test_goals.py similarity index 98% rename from watcher/tests/api/v1/test_goals.py rename to watcher/tests/unit/api/v1/test_goals.py index 7bbe3d04f..69cb4add2 100644 --- a/watcher/tests/api/v1/test_goals.py +++ b/watcher/tests/unit/api/v1/test_goals.py @@ -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): diff --git a/watcher/tests/api/v1/test_microversions.py b/watcher/tests/unit/api/v1/test_microversions.py similarity index 98% rename from watcher/tests/api/v1/test_microversions.py rename to watcher/tests/unit/api/v1/test_microversions.py index 0025df3be..a761a9131 100644 --- a/watcher/tests/api/v1/test_microversions.py +++ b/watcher/tests/unit/api/v1/test_microversions.py @@ -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' diff --git a/watcher/tests/api/v1/test_root.py b/watcher/tests/unit/api/v1/test_root.py similarity index 92% rename from watcher/tests/api/v1/test_root.py rename to watcher/tests/unit/api/v1/test_root.py index 8dffaeede..180c0b3d7 100644 --- a/watcher/tests/api/v1/test_root.py +++ b/watcher/tests/unit/api/v1/test_root.py @@ -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): diff --git a/watcher/tests/api/v1/test_scoring_engines.py b/watcher/tests/unit/api/v1/test_scoring_engines.py similarity index 98% rename from watcher/tests/api/v1/test_scoring_engines.py rename to watcher/tests/unit/api/v1/test_scoring_engines.py index d6624321f..5b0374715 100644 --- a/watcher/tests/api/v1/test_scoring_engines.py +++ b/watcher/tests/unit/api/v1/test_scoring_engines.py @@ -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): diff --git a/watcher/tests/api/v1/test_services.py b/watcher/tests/unit/api/v1/test_services.py similarity index 98% rename from watcher/tests/api/v1/test_services.py rename to watcher/tests/unit/api/v1/test_services.py index e73f0eda2..6ecbf73e8 100644 --- a/watcher/tests/api/v1/test_services.py +++ b/watcher/tests/unit/api/v1/test_services.py @@ -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): diff --git a/watcher/tests/api/v1/test_strategies.py b/watcher/tests/unit/api/v1/test_strategies.py similarity index 99% rename from watcher/tests/api/v1/test_strategies.py rename to watcher/tests/unit/api/v1/test_strategies.py index 05a19bbed..2198931af 100644 --- a/watcher/tests/api/v1/test_strategies.py +++ b/watcher/tests/unit/api/v1/test_strategies.py @@ -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): diff --git a/watcher/tests/api/v1/test_types.py b/watcher/tests/unit/api/v1/test_types.py similarity index 99% rename from watcher/tests/api/v1/test_types.py rename to watcher/tests/unit/api/v1/test_types.py index 782dbafe6..05f2eb4b6 100644 --- a/watcher/tests/api/v1/test_types.py +++ b/watcher/tests/unit/api/v1/test_types.py @@ -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): diff --git a/watcher/tests/api/v1/test_utils.py b/watcher/tests/unit/api/v1/test_utils.py similarity index 98% rename from watcher/tests/api/v1/test_utils.py rename to watcher/tests/unit/api/v1/test_utils.py index e5541ddc2..4acb4905e 100644 --- a/watcher/tests/api/v1/test_utils.py +++ b/watcher/tests/unit/api/v1/test_utils.py @@ -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 diff --git a/watcher/tests/api/v1/test_webhooks.py b/watcher/tests/unit/api/v1/test_webhooks.py similarity index 96% rename from watcher/tests/api/v1/test_webhooks.py rename to watcher/tests/unit/api/v1/test_webhooks.py index cc30e8b79..e2b69c05a 100644 --- a/watcher/tests/api/v1/test_webhooks.py +++ b/watcher/tests/unit/api/v1/test_webhooks.py @@ -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): diff --git a/watcher/tests/applier/__init__.py b/watcher/tests/unit/applier/__init__.py similarity index 100% rename from watcher/tests/applier/__init__.py rename to watcher/tests/unit/applier/__init__.py diff --git a/watcher/tests/applier/action_plan/__init__.py b/watcher/tests/unit/applier/action_plan/__init__.py similarity index 100% rename from watcher/tests/applier/action_plan/__init__.py rename to watcher/tests/unit/applier/action_plan/__init__.py diff --git a/watcher/tests/applier/action_plan/test_default_action_handler.py b/watcher/tests/unit/applier/action_plan/test_default_action_handler.py similarity index 99% rename from watcher/tests/applier/action_plan/test_default_action_handler.py rename to watcher/tests/unit/applier/action_plan/test_default_action_handler.py index 698ba8a64..37332b559 100644 --- a/watcher/tests/applier/action_plan/test_default_action_handler.py +++ b/watcher/tests/unit/applier/action_plan/test_default_action_handler.py @@ -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): diff --git a/watcher/tests/applier/actions/__init__.py b/watcher/tests/unit/applier/actions/__init__.py similarity index 100% rename from watcher/tests/applier/actions/__init__.py rename to watcher/tests/unit/applier/actions/__init__.py diff --git a/watcher/tests/applier/actions/loading/__init__.py b/watcher/tests/unit/applier/actions/loading/__init__.py similarity index 100% rename from watcher/tests/applier/actions/loading/__init__.py rename to watcher/tests/unit/applier/actions/loading/__init__.py diff --git a/watcher/tests/applier/actions/loading/test_default_actions_loader.py b/watcher/tests/unit/applier/actions/loading/test_default_actions_loader.py similarity index 96% rename from watcher/tests/applier/actions/loading/test_default_actions_loader.py rename to watcher/tests/unit/applier/actions/loading/test_default_actions_loader.py index b7015c675..9ecfb63c5 100644 --- a/watcher/tests/applier/actions/loading/test_default_actions_loader.py +++ b/watcher/tests/unit/applier/actions/loading/test_default_actions_loader.py @@ -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): diff --git a/watcher/tests/applier/actions/test_change_node_power_state.py b/watcher/tests/unit/applier/actions/test_change_node_power_state.py similarity index 98% rename from watcher/tests/applier/actions/test_change_node_power_state.py rename to watcher/tests/unit/applier/actions/test_change_node_power_state.py index c216d7bc6..67979a102 100644 --- a/watcher/tests/applier/actions/test_change_node_power_state.py +++ b/watcher/tests/unit/applier/actions/test_change_node_power_state.py @@ -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" diff --git a/watcher/tests/applier/actions/test_change_nova_service_state.py b/watcher/tests/unit/applier/actions/test_change_nova_service_state.py similarity index 99% rename from watcher/tests/applier/actions/test_change_nova_service_state.py rename to watcher/tests/unit/applier/actions/test_change_nova_service_state.py index 46d9479ac..0055be67e 100644 --- a/watcher/tests/applier/actions/test_change_nova_service_state.py +++ b/watcher/tests/unit/applier/actions/test_change_nova_service_state.py @@ -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): diff --git a/watcher/tests/applier/actions/test_migration.py b/watcher/tests/unit/applier/actions/test_migration.py similarity index 99% rename from watcher/tests/applier/actions/test_migration.py rename to watcher/tests/unit/applier/actions/test_migration.py index d941dc6b4..aee6fc5bc 100644 --- a/watcher/tests/applier/actions/test_migration.py +++ b/watcher/tests/unit/applier/actions/test_migration.py @@ -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): diff --git a/watcher/tests/applier/actions/test_resize.py b/watcher/tests/unit/applier/actions/test_resize.py similarity index 98% rename from watcher/tests/applier/actions/test_resize.py rename to watcher/tests/unit/applier/actions/test_resize.py index 51360abb8..2ecf5a685 100644 --- a/watcher/tests/applier/actions/test_resize.py +++ b/watcher/tests/unit/applier/actions/test_resize.py @@ -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): diff --git a/watcher/tests/applier/actions/test_sleep.py b/watcher/tests/unit/applier/actions/test_sleep.py similarity index 97% rename from watcher/tests/applier/actions/test_sleep.py rename to watcher/tests/unit/applier/actions/test_sleep.py index 5458cac61..ba1328a97 100644 --- a/watcher/tests/applier/actions/test_sleep.py +++ b/watcher/tests/unit/applier/actions/test_sleep.py @@ -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): diff --git a/watcher/tests/applier/actions/test_stop.py b/watcher/tests/unit/applier/actions/test_stop.py similarity index 99% rename from watcher/tests/applier/actions/test_stop.py rename to watcher/tests/unit/applier/actions/test_stop.py index 721ea9e86..f7169e251 100644 --- a/watcher/tests/applier/actions/test_stop.py +++ b/watcher/tests/unit/applier/actions/test_stop.py @@ -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): diff --git a/watcher/tests/applier/actions/test_volume_migration.py b/watcher/tests/unit/applier/actions/test_volume_migration.py similarity index 99% rename from watcher/tests/applier/actions/test_volume_migration.py rename to watcher/tests/unit/applier/actions/test_volume_migration.py index 39d95a6b5..2706b49b8 100644 --- a/watcher/tests/applier/actions/test_volume_migration.py +++ b/watcher/tests/unit/applier/actions/test_volume_migration.py @@ -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): diff --git a/watcher/tests/applier/messaging/__init__.py b/watcher/tests/unit/applier/messaging/__init__.py similarity index 100% rename from watcher/tests/applier/messaging/__init__.py rename to watcher/tests/unit/applier/messaging/__init__.py diff --git a/watcher/tests/applier/messaging/test_trigger_action_plan_endpoint.py b/watcher/tests/unit/applier/messaging/test_trigger_action_plan_endpoint.py similarity index 98% rename from watcher/tests/applier/messaging/test_trigger_action_plan_endpoint.py rename to watcher/tests/unit/applier/messaging/test_trigger_action_plan_endpoint.py index cfd896a01..d5e35e82c 100644 --- a/watcher/tests/applier/messaging/test_trigger_action_plan_endpoint.py +++ b/watcher/tests/unit/applier/messaging/test_trigger_action_plan_endpoint.py @@ -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 diff --git a/watcher/tests/applier/test_applier_manager.py b/watcher/tests/unit/applier/test_applier_manager.py similarity index 97% rename from watcher/tests/applier/test_applier_manager.py rename to watcher/tests/unit/applier/test_applier_manager.py index f55ff85a3..575c29826 100644 --- a/watcher/tests/applier/test_applier_manager.py +++ b/watcher/tests/unit/applier/test_applier_manager.py @@ -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): diff --git a/watcher/tests/applier/test_rpcapi.py b/watcher/tests/unit/applier/test_rpcapi.py similarity index 98% rename from watcher/tests/applier/test_rpcapi.py rename to watcher/tests/unit/applier/test_rpcapi.py index e9ec6febf..d4b8f27f4 100644 --- a/watcher/tests/applier/test_rpcapi.py +++ b/watcher/tests/unit/applier/test_rpcapi.py @@ -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): diff --git a/watcher/tests/applier/test_sync.py b/watcher/tests/unit/applier/test_sync.py similarity index 96% rename from watcher/tests/applier/test_sync.py rename to watcher/tests/unit/applier/test_sync.py index a6f641c0c..4768f9b0e 100644 --- a/watcher/tests/applier/test_sync.py +++ b/watcher/tests/unit/applier/test_sync.py @@ -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): diff --git a/watcher/tests/applier/workflow_engine/__init__.py b/watcher/tests/unit/applier/workflow_engine/__init__.py similarity index 100% rename from watcher/tests/applier/workflow_engine/__init__.py rename to watcher/tests/unit/applier/workflow_engine/__init__.py diff --git a/watcher/tests/applier/workflow_engine/loading/__init__.py b/watcher/tests/unit/applier/workflow_engine/loading/__init__.py similarity index 100% rename from watcher/tests/applier/workflow_engine/loading/__init__.py rename to watcher/tests/unit/applier/workflow_engine/loading/__init__.py diff --git a/watcher/tests/applier/workflow_engine/loading/test_default_engine_loader.py b/watcher/tests/unit/applier/workflow_engine/loading/test_default_engine_loader.py similarity index 96% rename from watcher/tests/applier/workflow_engine/loading/test_default_engine_loader.py rename to watcher/tests/unit/applier/workflow_engine/loading/test_default_engine_loader.py index 024b4e475..b1217dab5 100644 --- a/watcher/tests/applier/workflow_engine/loading/test_default_engine_loader.py +++ b/watcher/tests/unit/applier/workflow_engine/loading/test_default_engine_loader.py @@ -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): diff --git a/watcher/tests/applier/workflow_engine/test_default_workflow_engine.py b/watcher/tests/unit/applier/workflow_engine/test_default_workflow_engine.py similarity index 99% rename from watcher/tests/applier/workflow_engine/test_default_workflow_engine.py rename to watcher/tests/unit/applier/workflow_engine/test_default_workflow_engine.py index 1ec72d0ec..1c4f7cc6a 100644 --- a/watcher/tests/applier/workflow_engine/test_default_workflow_engine.py +++ b/watcher/tests/unit/applier/workflow_engine/test_default_workflow_engine.py @@ -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): diff --git a/watcher/tests/applier/workflow_engine/test_taskflow_action_container.py b/watcher/tests/unit/applier/workflow_engine/test_taskflow_action_container.py similarity index 99% rename from watcher/tests/applier/workflow_engine/test_taskflow_action_container.py rename to watcher/tests/unit/applier/workflow_engine/test_taskflow_action_container.py index 53e4c8cd6..0360e3e89 100644 --- a/watcher/tests/applier/workflow_engine/test_taskflow_action_container.py +++ b/watcher/tests/unit/applier/workflow_engine/test_taskflow_action_container.py @@ -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): diff --git a/watcher/tests/base.py b/watcher/tests/unit/base.py similarity index 98% rename from watcher/tests/base.py rename to watcher/tests/unit/base.py index d1727436c..14b198f2f 100644 --- a/watcher/tests/base.py +++ b/watcher/tests/unit/base.py @@ -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 diff --git a/watcher/tests/cmd/__init__.py b/watcher/tests/unit/cmd/__init__.py similarity index 100% rename from watcher/tests/cmd/__init__.py rename to watcher/tests/unit/cmd/__init__.py diff --git a/watcher/tests/cmd/test_api.py b/watcher/tests/unit/cmd/test_api.py similarity index 98% rename from watcher/tests/cmd/test_api.py rename to watcher/tests/unit/cmd/test_api.py index 4f4c8d47a..95a3f083c 100644 --- a/watcher/tests/cmd/test_api.py +++ b/watcher/tests/unit/cmd/test_api.py @@ -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): diff --git a/watcher/tests/cmd/test_applier.py b/watcher/tests/unit/cmd/test_applier.py similarity index 97% rename from watcher/tests/cmd/test_applier.py rename to watcher/tests/unit/cmd/test_applier.py index 7a21e39ae..16bce8c35 100644 --- a/watcher/tests/cmd/test_applier.py +++ b/watcher/tests/unit/cmd/test_applier.py @@ -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): diff --git a/watcher/tests/cmd/test_db_manage.py b/watcher/tests/unit/cmd/test_db_manage.py similarity index 99% rename from watcher/tests/cmd/test_db_manage.py rename to watcher/tests/unit/cmd/test_db_manage.py index 8fe8ba8ad..88d5031f0 100644 --- a/watcher/tests/cmd/test_db_manage.py +++ b/watcher/tests/unit/cmd/test_db_manage.py @@ -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): diff --git a/watcher/tests/cmd/test_decision_engine.py b/watcher/tests/unit/cmd/test_decision_engine.py similarity index 98% rename from watcher/tests/cmd/test_decision_engine.py rename to watcher/tests/unit/cmd/test_decision_engine.py index 0d904bf92..ccef053cc 100644 --- a/watcher/tests/cmd/test_decision_engine.py +++ b/watcher/tests/unit/cmd/test_decision_engine.py @@ -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): diff --git a/watcher/tests/cmd/test_status.py b/watcher/tests/unit/cmd/test_status.py similarity index 97% rename from watcher/tests/cmd/test_status.py rename to watcher/tests/unit/cmd/test_status.py index c54b22693..2c9786ccc 100644 --- a/watcher/tests/cmd/test_status.py +++ b/watcher/tests/unit/cmd/test_status.py @@ -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 diff --git a/watcher/tests/common/__init__.py b/watcher/tests/unit/common/__init__.py similarity index 100% rename from watcher/tests/common/__init__.py rename to watcher/tests/unit/common/__init__.py diff --git a/watcher/tests/common/loader/__init__.py b/watcher/tests/unit/common/loader/__init__.py similarity index 100% rename from watcher/tests/common/loader/__init__.py rename to watcher/tests/unit/common/loader/__init__.py diff --git a/watcher/tests/common/loader/test_loader.py b/watcher/tests/unit/common/loader/test_loader.py similarity index 98% rename from watcher/tests/common/loader/test_loader.py rename to watcher/tests/unit/common/loader/test_loader.py index f4e7e1e06..935f4e523 100644 --- a/watcher/tests/common/loader/test_loader.py +++ b/watcher/tests/unit/common/loader/test_loader.py @@ -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): diff --git a/watcher/tests/common/metal_helper/__init__.py b/watcher/tests/unit/common/metal_helper/__init__.py similarity index 100% rename from watcher/tests/common/metal_helper/__init__.py rename to watcher/tests/unit/common/metal_helper/__init__.py diff --git a/watcher/tests/common/metal_helper/test_base.py b/watcher/tests/unit/common/metal_helper/test_base.py similarity index 98% rename from watcher/tests/common/metal_helper/test_base.py rename to watcher/tests/unit/common/metal_helper/test_base.py index 3547ec94f..af35db674 100644 --- a/watcher/tests/common/metal_helper/test_base.py +++ b/watcher/tests/unit/common/metal_helper/test_base.py @@ -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 diff --git a/watcher/tests/common/metal_helper/test_factory.py b/watcher/tests/unit/common/metal_helper/test_factory.py similarity index 97% rename from watcher/tests/common/metal_helper/test_factory.py rename to watcher/tests/unit/common/metal_helper/test_factory.py index 0ba114ba1..ba918d07a 100644 --- a/watcher/tests/common/metal_helper/test_factory.py +++ b/watcher/tests/unit/common/metal_helper/test_factory.py @@ -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): diff --git a/watcher/tests/common/metal_helper/test_ironic.py b/watcher/tests/unit/common/metal_helper/test_ironic.py similarity index 99% rename from watcher/tests/common/metal_helper/test_ironic.py rename to watcher/tests/unit/common/metal_helper/test_ironic.py index 6f88e647f..c7d1f04ee 100644 --- a/watcher/tests/common/metal_helper/test_ironic.py +++ b/watcher/tests/unit/common/metal_helper/test_ironic.py @@ -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): diff --git a/watcher/tests/common/metal_helper/test_maas.py b/watcher/tests/unit/common/metal_helper/test_maas.py similarity index 99% rename from watcher/tests/common/metal_helper/test_maas.py rename to watcher/tests/unit/common/metal_helper/test_maas.py index 26ccd8236..88d6a1648 100644 --- a/watcher/tests/common/metal_helper/test_maas.py +++ b/watcher/tests/unit/common/metal_helper/test_maas.py @@ -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): diff --git a/watcher/tests/common/test_cinder_helper.py b/watcher/tests/unit/common/test_cinder_helper.py similarity index 99% rename from watcher/tests/common/test_cinder_helper.py rename to watcher/tests/unit/common/test_cinder_helper.py index a9a11784f..faa01361f 100644 --- a/watcher/tests/common/test_cinder_helper.py +++ b/watcher/tests/unit/common/test_cinder_helper.py @@ -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') diff --git a/watcher/tests/common/test_clients.py b/watcher/tests/unit/common/test_clients.py similarity index 99% rename from watcher/tests/common/test_clients.py rename to watcher/tests/unit/common/test_clients.py index cf7671cff..e12a4ba7a 100644 --- a/watcher/tests/common/test_clients.py +++ b/watcher/tests/unit/common/test_clients.py @@ -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 diff --git a/watcher/tests/common/test_executor.py b/watcher/tests/unit/common/test_executor.py similarity index 98% rename from watcher/tests/common/test_executor.py rename to watcher/tests/unit/common/test_executor.py index 8a4916e7c..e074dc5ab 100644 --- a/watcher/tests/common/test_executor.py +++ b/watcher/tests/unit/common/test_executor.py @@ -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') diff --git a/watcher/tests/common/test_ironic_helper.py b/watcher/tests/unit/common/test_ironic_helper.py similarity index 98% rename from watcher/tests/common/test_ironic_helper.py rename to watcher/tests/unit/common/test_ironic_helper.py index 8668fe91b..b47604294 100644 --- a/watcher/tests/common/test_ironic_helper.py +++ b/watcher/tests/unit/common/test_ironic_helper.py @@ -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): diff --git a/watcher/tests/common/test_keystone_helper.py b/watcher/tests/unit/common/test_keystone_helper.py similarity index 98% rename from watcher/tests/common/test_keystone_helper.py rename to watcher/tests/unit/common/test_keystone_helper.py index 73762aa9b..0f91a5b04 100644 --- a/watcher/tests/common/test_keystone_helper.py +++ b/watcher/tests/unit/common/test_keystone_helper.py @@ -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): diff --git a/watcher/tests/common/test_nova_helper.py b/watcher/tests/unit/common/test_nova_helper.py similarity index 99% rename from watcher/tests/common/test_nova_helper.py rename to watcher/tests/unit/common/test_nova_helper.py index c18d69e1b..feb24bce4 100644 --- a/watcher/tests/common/test_nova_helper.py +++ b/watcher/tests/unit/common/test_nova_helper.py @@ -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 diff --git a/watcher/tests/common/test_oslo_service_helper.py b/watcher/tests/unit/common/test_oslo_service_helper.py similarity index 97% rename from watcher/tests/common/test_oslo_service_helper.py rename to watcher/tests/unit/common/test_oslo_service_helper.py index 6933fc678..edc648883 100644 --- a/watcher/tests/common/test_oslo_service_helper.py +++ b/watcher/tests/unit/common/test_oslo_service_helper.py @@ -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): diff --git a/watcher/tests/common/test_placement_helper.py b/watcher/tests/unit/common/test_placement_helper.py similarity index 99% rename from watcher/tests/common/test_placement_helper.py rename to watcher/tests/unit/common/test_placement_helper.py index fad3cef09..cc80043a4 100644 --- a/watcher/tests/common/test_placement_helper.py +++ b/watcher/tests/unit/common/test_placement_helper.py @@ -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 diff --git a/watcher/tests/common/test_scheduling.py b/watcher/tests/unit/common/test_scheduling.py similarity index 98% rename from watcher/tests/common/test_scheduling.py rename to watcher/tests/unit/common/test_scheduling.py index 88e3eb380..a8b58b14a 100644 --- a/watcher/tests/common/test_scheduling.py +++ b/watcher/tests/unit/common/test_scheduling.py @@ -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): diff --git a/watcher/tests/common/test_service.py b/watcher/tests/unit/common/test_service.py similarity index 99% rename from watcher/tests/common/test_service.py rename to watcher/tests/unit/common/test_service.py index 008c2cba8..b50b6531a 100644 --- a/watcher/tests/common/test_service.py +++ b/watcher/tests/unit/common/test_service.py @@ -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 diff --git a/watcher/tests/common/test_utils.py b/watcher/tests/unit/common/test_utils.py similarity index 97% rename from watcher/tests/common/test_utils.py rename to watcher/tests/unit/common/test_utils.py index bcbb1bdc4..f9bb4ac35 100644 --- a/watcher/tests/common/test_utils.py +++ b/watcher/tests/unit/common/test_utils.py @@ -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): diff --git a/watcher/tests/conf/__init__.py b/watcher/tests/unit/conf/__init__.py similarity index 100% rename from watcher/tests/conf/__init__.py rename to watcher/tests/unit/conf/__init__.py diff --git a/watcher/tests/conf/test_list_opts.py b/watcher/tests/unit/conf/test_list_opts.py similarity index 97% rename from watcher/tests/conf/test_list_opts.py rename to watcher/tests/unit/conf/test_list_opts.py index 3ff19af58..8b89f37eb 100644 --- a/watcher/tests/conf/test_list_opts.py +++ b/watcher/tests/unit/conf/test_list_opts.py @@ -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')]) diff --git a/watcher/tests/config.py b/watcher/tests/unit/config.py similarity index 100% rename from watcher/tests/config.py rename to watcher/tests/unit/config.py diff --git a/watcher/tests/db/__init__.py b/watcher/tests/unit/db/__init__.py similarity index 100% rename from watcher/tests/db/__init__.py rename to watcher/tests/unit/db/__init__.py diff --git a/watcher/tests/db/base.py b/watcher/tests/unit/db/base.py similarity index 97% rename from watcher/tests/db/base.py rename to watcher/tests/unit/db/base.py index 9e97f26fe..040a8541b 100644 --- a/watcher/tests/db/base.py +++ b/watcher/tests/unit/db/base.py @@ -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 diff --git a/watcher/tests/db/test_action.py b/watcher/tests/unit/db/test_action.py similarity index 99% rename from watcher/tests/db/test_action.py rename to watcher/tests/unit/db/test_action.py index d0b0793ad..a4dae7292 100644 --- a/watcher/tests/db/test_action.py +++ b/watcher/tests/unit/db/test_action.py @@ -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): diff --git a/watcher/tests/db/test_action_description.py b/watcher/tests/unit/db/test_action_description.py similarity index 99% rename from watcher/tests/db/test_action_description.py rename to watcher/tests/unit/db/test_action_description.py index f3ee558a2..058c7f2ca 100644 --- a/watcher/tests/db/test_action_description.py +++ b/watcher/tests/unit/db/test_action_description.py @@ -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): diff --git a/watcher/tests/db/test_action_plan.py b/watcher/tests/unit/db/test_action_plan.py similarity index 99% rename from watcher/tests/db/test_action_plan.py rename to watcher/tests/unit/db/test_action_plan.py index 936e43f67..381498036 100644 --- a/watcher/tests/db/test_action_plan.py +++ b/watcher/tests/unit/db/test_action_plan.py @@ -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): diff --git a/watcher/tests/db/test_audit.py b/watcher/tests/unit/db/test_audit.py similarity index 99% rename from watcher/tests/db/test_audit.py rename to watcher/tests/unit/db/test_audit.py index 831d873a7..834f2fdc7 100644 --- a/watcher/tests/db/test_audit.py +++ b/watcher/tests/unit/db/test_audit.py @@ -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): diff --git a/watcher/tests/db/test_audit_template.py b/watcher/tests/unit/db/test_audit_template.py similarity index 99% rename from watcher/tests/db/test_audit_template.py rename to watcher/tests/unit/db/test_audit_template.py index 86f7b0a23..6ba88d0b2 100644 --- a/watcher/tests/db/test_audit_template.py +++ b/watcher/tests/unit/db/test_audit_template.py @@ -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): diff --git a/watcher/tests/db/test_efficacy_indicator.py b/watcher/tests/unit/db/test_efficacy_indicator.py similarity index 99% rename from watcher/tests/db/test_efficacy_indicator.py rename to watcher/tests/unit/db/test_efficacy_indicator.py index 30e73b49c..7d8829292 100644 --- a/watcher/tests/db/test_efficacy_indicator.py +++ b/watcher/tests/unit/db/test_efficacy_indicator.py @@ -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): diff --git a/watcher/tests/db/test_goal.py b/watcher/tests/unit/db/test_goal.py similarity index 99% rename from watcher/tests/db/test_goal.py rename to watcher/tests/unit/db/test_goal.py index 69af79515..24fa59fd6 100644 --- a/watcher/tests/db/test_goal.py +++ b/watcher/tests/unit/db/test_goal.py @@ -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): diff --git a/watcher/tests/db/test_migrations.py b/watcher/tests/unit/db/test_migrations.py similarity index 99% rename from watcher/tests/db/test_migrations.py rename to watcher/tests/unit/db/test_migrations.py index 4ce051180..954c4d736 100644 --- a/watcher/tests/db/test_migrations.py +++ b/watcher/tests/unit/db/test_migrations.py @@ -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__) diff --git a/watcher/tests/db/test_purge.py b/watcher/tests/unit/db/test_purge.py similarity index 99% rename from watcher/tests/db/test_purge.py rename to watcher/tests/unit/db/test_purge.py index b77215659..e74966b6a 100644 --- a/watcher/tests/db/test_purge.py +++ b/watcher/tests/unit/db/test_purge.py @@ -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): diff --git a/watcher/tests/db/test_scoring_engine.py b/watcher/tests/unit/db/test_scoring_engine.py similarity index 99% rename from watcher/tests/db/test_scoring_engine.py rename to watcher/tests/unit/db/test_scoring_engine.py index 8f6b13213..eb8cc8202 100644 --- a/watcher/tests/db/test_scoring_engine.py +++ b/watcher/tests/unit/db/test_scoring_engine.py @@ -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): diff --git a/watcher/tests/db/test_service.py b/watcher/tests/unit/db/test_service.py similarity index 99% rename from watcher/tests/db/test_service.py rename to watcher/tests/unit/db/test_service.py index 8f5826432..27ccd5118 100644 --- a/watcher/tests/db/test_service.py +++ b/watcher/tests/unit/db/test_service.py @@ -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): diff --git a/watcher/tests/db/test_strategy.py b/watcher/tests/unit/db/test_strategy.py similarity index 99% rename from watcher/tests/db/test_strategy.py rename to watcher/tests/unit/db/test_strategy.py index 2592a3d14..1f10e8f84 100644 --- a/watcher/tests/db/test_strategy.py +++ b/watcher/tests/unit/db/test_strategy.py @@ -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): diff --git a/watcher/tests/db/utils.py b/watcher/tests/unit/db/utils.py similarity index 100% rename from watcher/tests/db/utils.py rename to watcher/tests/unit/db/utils.py diff --git a/watcher/tests/decision_engine/__init__.py b/watcher/tests/unit/decision_engine/__init__.py similarity index 100% rename from watcher/tests/decision_engine/__init__.py rename to watcher/tests/unit/decision_engine/__init__.py diff --git a/watcher/tests/decision_engine/audit/__init__.py b/watcher/tests/unit/decision_engine/audit/__init__.py similarity index 100% rename from watcher/tests/decision_engine/audit/__init__.py rename to watcher/tests/unit/decision_engine/audit/__init__.py diff --git a/watcher/tests/decision_engine/audit/test_audit_handlers.py b/watcher/tests/unit/decision_engine/audit/test_audit_handlers.py similarity index 99% rename from watcher/tests/decision_engine/audit/test_audit_handlers.py rename to watcher/tests/unit/decision_engine/audit/test_audit_handlers.py index f17fc310a..20c19acf5 100644 --- a/watcher/tests/decision_engine/audit/test_audit_handlers.py +++ b/watcher/tests/unit/decision_engine/audit/test_audit_handlers.py @@ -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): diff --git a/watcher/tests/decision_engine/cluster/__init__.py b/watcher/tests/unit/decision_engine/cluster/__init__.py similarity index 100% rename from watcher/tests/decision_engine/cluster/__init__.py rename to watcher/tests/unit/decision_engine/cluster/__init__.py diff --git a/watcher/tests/decision_engine/cluster/test_cinder_cdmc.py b/watcher/tests/unit/decision_engine/cluster/test_cinder_cdmc.py similarity index 98% rename from watcher/tests/decision_engine/cluster/test_cinder_cdmc.py rename to watcher/tests/unit/decision_engine/cluster/test_cinder_cdmc.py index 576a776a9..df34be1c6 100644 --- a/watcher/tests/decision_engine/cluster/test_cinder_cdmc.py +++ b/watcher/tests/unit/decision_engine/cluster/test_cinder_cdmc.py @@ -16,8 +16,8 @@ from unittest import mock from watcher.common import cinder_helper from watcher.common import exception from watcher.decision_engine.model.collector import cinder -from watcher.tests import base -from watcher.tests import conf_fixture +from watcher.tests.fixtures import conf_fixture +from watcher.tests.unit import base class TestCinderClusterDataModelCollector(base.TestCase): diff --git a/watcher/tests/decision_engine/cluster/test_cluster_data_model_collector.py b/watcher/tests/unit/decision_engine/cluster/test_cluster_data_model_collector.py similarity index 98% rename from watcher/tests/decision_engine/cluster/test_cluster_data_model_collector.py rename to watcher/tests/unit/decision_engine/cluster/test_cluster_data_model_collector.py index 05c334c40..a948cbcf0 100644 --- a/watcher/tests/decision_engine/cluster/test_cluster_data_model_collector.py +++ b/watcher/tests/unit/decision_engine/cluster/test_cluster_data_model_collector.py @@ -20,7 +20,7 @@ from watcher.decision_engine.model.collector import cinder from watcher.decision_engine.model.collector import ironic from watcher.decision_engine.model.collector import nova from watcher.decision_engine.model import model_root -from watcher.tests import base as test_base +from watcher.tests.unit import base as test_base class DummyClusterDataModelCollector(base.BaseClusterDataModelCollector): diff --git a/watcher/tests/decision_engine/cluster/test_nova_cdmc.py b/watcher/tests/unit/decision_engine/cluster/test_nova_cdmc.py similarity index 99% rename from watcher/tests/decision_engine/cluster/test_nova_cdmc.py rename to watcher/tests/unit/decision_engine/cluster/test_nova_cdmc.py index 829705578..56c5cdcd3 100644 --- a/watcher/tests/decision_engine/cluster/test_nova_cdmc.py +++ b/watcher/tests/unit/decision_engine/cluster/test_nova_cdmc.py @@ -23,8 +23,8 @@ from watcher.common import nova_helper from watcher.common import placement_helper from watcher.decision_engine.model.collector import nova from watcher.decision_engine.model import model_root -from watcher.tests import base -from watcher.tests import conf_fixture +from watcher.tests.fixtures import conf_fixture +from watcher.tests.unit import base @ddt.ddt diff --git a/watcher/tests/decision_engine/datasources/__init__.py b/watcher/tests/unit/decision_engine/datasources/__init__.py similarity index 100% rename from watcher/tests/decision_engine/datasources/__init__.py rename to watcher/tests/unit/decision_engine/datasources/__init__.py diff --git a/watcher/tests/decision_engine/datasources/grafana_translators/__init__.py b/watcher/tests/unit/decision_engine/datasources/grafana_translators/__init__.py similarity index 100% rename from watcher/tests/decision_engine/datasources/grafana_translators/__init__.py rename to watcher/tests/unit/decision_engine/datasources/grafana_translators/__init__.py diff --git a/watcher/tests/decision_engine/datasources/grafana_translators/test_base.py b/watcher/tests/unit/decision_engine/datasources/grafana_translators/test_base.py similarity index 99% rename from watcher/tests/decision_engine/datasources/grafana_translators/test_base.py rename to watcher/tests/unit/decision_engine/datasources/grafana_translators/test_base.py index 484107b14..55470a405 100644 --- a/watcher/tests/decision_engine/datasources/grafana_translators/test_base.py +++ b/watcher/tests/unit/decision_engine/datasources/grafana_translators/test_base.py @@ -23,7 +23,7 @@ from oslo_log import log from watcher.common import exception from watcher.decision_engine.datasources.grafana_translator import \ base as base_translator -from watcher.tests import base +from watcher.tests.unit import base CONF = cfg.CONF LOG = log.getLogger(__name__) diff --git a/watcher/tests/decision_engine/datasources/grafana_translators/test_influxdb.py b/watcher/tests/unit/decision_engine/datasources/grafana_translators/test_influxdb.py similarity index 98% rename from watcher/tests/decision_engine/datasources/grafana_translators/test_influxdb.py rename to watcher/tests/unit/decision_engine/datasources/grafana_translators/test_influxdb.py index 7ed0e7c51..ebf30bd6d 100644 --- a/watcher/tests/decision_engine/datasources/grafana_translators/test_influxdb.py +++ b/watcher/tests/unit/decision_engine/datasources/grafana_translators/test_influxdb.py @@ -23,8 +23,8 @@ from oslo_log import log from watcher.common import exception from watcher.decision_engine.datasources.grafana_translator import influxdb -from watcher.tests.decision_engine.datasources.grafana_translators import \ - test_base +from watcher.tests.unit.decision_engine.datasources. \ + grafana_translators import test_base CONF = cfg.CONF LOG = log.getLogger(__name__) diff --git a/watcher/tests/decision_engine/datasources/test_aetos_helper.py b/watcher/tests/unit/decision_engine/datasources/test_aetos_helper.py similarity index 98% rename from watcher/tests/decision_engine/datasources/test_aetos_helper.py rename to watcher/tests/unit/decision_engine/datasources/test_aetos_helper.py index 936e212ad..11cfaa422 100644 --- a/watcher/tests/decision_engine/datasources/test_aetos_helper.py +++ b/watcher/tests/unit/decision_engine/datasources/test_aetos_helper.py @@ -18,7 +18,7 @@ from observabilityclient.utils import metric_utils as obs_client_utils from oslo_config import cfg from watcher.decision_engine.datasources import aetos as aetos_helper -from watcher.tests import base +from watcher.tests.unit import base class TestAetosHelper(base.BaseTestCase): diff --git a/watcher/tests/decision_engine/datasources/test_base.py b/watcher/tests/unit/decision_engine/datasources/test_base.py similarity index 98% rename from watcher/tests/decision_engine/datasources/test_base.py rename to watcher/tests/unit/decision_engine/datasources/test_base.py index 579024919..b1b9d216d 100644 --- a/watcher/tests/decision_engine/datasources/test_base.py +++ b/watcher/tests/unit/decision_engine/datasources/test_base.py @@ -20,7 +20,7 @@ from unittest import mock from oslo_config import cfg from watcher.decision_engine.datasources import base as datasource -from watcher.tests import base +from watcher.tests.unit import base CONF = cfg.CONF diff --git a/watcher/tests/decision_engine/datasources/test_gnocchi_helper.py b/watcher/tests/unit/decision_engine/datasources/test_gnocchi_helper.py similarity index 99% rename from watcher/tests/decision_engine/datasources/test_gnocchi_helper.py rename to watcher/tests/unit/decision_engine/datasources/test_gnocchi_helper.py index f0b00f516..78c98967a 100644 --- a/watcher/tests/decision_engine/datasources/test_gnocchi_helper.py +++ b/watcher/tests/unit/decision_engine/datasources/test_gnocchi_helper.py @@ -20,7 +20,7 @@ from oslo_config import cfg from watcher.common import clients from watcher.common import exception from watcher.decision_engine.datasources import gnocchi as gnocchi_helper -from watcher.tests import base +from watcher.tests.unit import base CONF = cfg.CONF diff --git a/watcher/tests/decision_engine/datasources/test_grafana_helper.py b/watcher/tests/unit/decision_engine/datasources/test_grafana_helper.py similarity index 99% rename from watcher/tests/decision_engine/datasources/test_grafana_helper.py rename to watcher/tests/unit/decision_engine/datasources/test_grafana_helper.py index 737170ac6..e2357e868 100644 --- a/watcher/tests/decision_engine/datasources/test_grafana_helper.py +++ b/watcher/tests/unit/decision_engine/datasources/test_grafana_helper.py @@ -23,7 +23,7 @@ from oslo_log import log from watcher.common import clients from watcher.common import exception from watcher.decision_engine.datasources import grafana -from watcher.tests import base +from watcher.tests.unit import base from http import HTTPStatus import requests diff --git a/watcher/tests/decision_engine/datasources/test_manager.py b/watcher/tests/unit/decision_engine/datasources/test_manager.py similarity index 99% rename from watcher/tests/decision_engine/datasources/test_manager.py rename to watcher/tests/unit/decision_engine/datasources/test_manager.py index 7bf5221de..acf517735 100644 --- a/watcher/tests/decision_engine/datasources/test_manager.py +++ b/watcher/tests/unit/decision_engine/datasources/test_manager.py @@ -31,7 +31,7 @@ try: MONASCA_INSTALLED = True except Exception: MONASCA_INSTALLED = False -from watcher.tests import base +from watcher.tests.unit import base class TestDataSourceManager(base.BaseTestCase): diff --git a/watcher/tests/decision_engine/datasources/test_monasca_helper.py b/watcher/tests/unit/decision_engine/datasources/test_monasca_helper.py similarity index 99% rename from watcher/tests/decision_engine/datasources/test_monasca_helper.py rename to watcher/tests/unit/decision_engine/datasources/test_monasca_helper.py index 5da229576..dbdc252c7 100644 --- a/watcher/tests/decision_engine/datasources/test_monasca_helper.py +++ b/watcher/tests/unit/decision_engine/datasources/test_monasca_helper.py @@ -28,7 +28,7 @@ try: MONASCA_INSTALLED = True except Exception: MONASCA_INSTALLED = False -from watcher.tests import base +from watcher.tests.unit import base CONF = cfg.CONF diff --git a/watcher/tests/decision_engine/datasources/test_prometheus_base.py b/watcher/tests/unit/decision_engine/datasources/test_prometheus_base.py similarity index 99% rename from watcher/tests/decision_engine/datasources/test_prometheus_base.py rename to watcher/tests/unit/decision_engine/datasources/test_prometheus_base.py index 292a55eac..02cd99896 100644 --- a/watcher/tests/decision_engine/datasources/test_prometheus_base.py +++ b/watcher/tests/unit/decision_engine/datasources/test_prometheus_base.py @@ -18,7 +18,7 @@ from observabilityclient import prometheus_client from watcher.common import exception from watcher.decision_engine.datasources import prometheus_base -from watcher.tests import base +from watcher.tests.unit import base class TestPrometheusBase(base.BaseTestCase): diff --git a/watcher/tests/decision_engine/datasources/test_prometheus_helper.py b/watcher/tests/unit/decision_engine/datasources/test_prometheus_helper.py similarity index 99% rename from watcher/tests/decision_engine/datasources/test_prometheus_helper.py rename to watcher/tests/unit/decision_engine/datasources/test_prometheus_helper.py index 37bead9a2..773ba5033 100644 --- a/watcher/tests/decision_engine/datasources/test_prometheus_helper.py +++ b/watcher/tests/unit/decision_engine/datasources/test_prometheus_helper.py @@ -19,7 +19,7 @@ from oslo_config import cfg from watcher.common import exception from watcher.decision_engine.datasources import prometheus as prometheus_helper -from watcher.tests import base +from watcher.tests.unit import base class TestPrometheusHelper(base.BaseTestCase): diff --git a/watcher/tests/decision_engine/event_consumer/__init__.py b/watcher/tests/unit/decision_engine/event_consumer/__init__.py similarity index 100% rename from watcher/tests/decision_engine/event_consumer/__init__.py rename to watcher/tests/unit/decision_engine/event_consumer/__init__.py diff --git a/watcher/tests/decision_engine/fake_goals.py b/watcher/tests/unit/decision_engine/fake_goals.py similarity index 100% rename from watcher/tests/decision_engine/fake_goals.py rename to watcher/tests/unit/decision_engine/fake_goals.py diff --git a/watcher/tests/decision_engine/fake_metal_helper.py b/watcher/tests/unit/decision_engine/fake_metal_helper.py similarity index 100% rename from watcher/tests/decision_engine/fake_metal_helper.py rename to watcher/tests/unit/decision_engine/fake_metal_helper.py diff --git a/watcher/tests/decision_engine/fake_strategies.py b/watcher/tests/unit/decision_engine/fake_strategies.py similarity index 100% rename from watcher/tests/decision_engine/fake_strategies.py rename to watcher/tests/unit/decision_engine/fake_strategies.py diff --git a/watcher/tests/decision_engine/loading/__init__.py b/watcher/tests/unit/decision_engine/loading/__init__.py similarity index 100% rename from watcher/tests/decision_engine/loading/__init__.py rename to watcher/tests/unit/decision_engine/loading/__init__.py diff --git a/watcher/tests/decision_engine/loading/test_collector_loader.py b/watcher/tests/unit/decision_engine/loading/test_collector_loader.py similarity index 94% rename from watcher/tests/decision_engine/loading/test_collector_loader.py rename to watcher/tests/unit/decision_engine/loading/test_collector_loader.py index ba28fc723..195f43065 100644 --- a/watcher/tests/decision_engine/loading/test_collector_loader.py +++ b/watcher/tests/unit/decision_engine/loading/test_collector_loader.py @@ -20,9 +20,9 @@ from unittest import mock from watcher.common import clients from watcher.common import exception from watcher.decision_engine.loading import default as default_loading -from watcher.tests import base -from watcher.tests import conf_fixture -from watcher.tests.decision_engine.model import faker_cluster_state +from watcher.tests.fixtures import conf_fixture +from watcher.tests.unit import base +from watcher.tests.unit.decision_engine.model import faker_cluster_state class TestClusterDataModelCollectorLoader(base.TestCase): diff --git a/watcher/tests/decision_engine/loading/test_default_planner_loader.py b/watcher/tests/unit/decision_engine/loading/test_default_planner_loader.py similarity index 96% rename from watcher/tests/decision_engine/loading/test_default_planner_loader.py rename to watcher/tests/unit/decision_engine/loading/test_default_planner_loader.py index 4ed58680e..00d19fddd 100644 --- a/watcher/tests/decision_engine/loading/test_default_planner_loader.py +++ b/watcher/tests/unit/decision_engine/loading/test_default_planner_loader.py @@ -15,7 +15,7 @@ from watcher.decision_engine.loading import default from watcher.decision_engine.planner import base as planner -from watcher.tests import base +from watcher.tests.unit import base class TestDefaultPlannerLoader(base.TestCase): diff --git a/watcher/tests/decision_engine/loading/test_default_strategy_loader.py b/watcher/tests/unit/decision_engine/loading/test_default_strategy_loader.py similarity index 98% rename from watcher/tests/decision_engine/loading/test_default_strategy_loader.py rename to watcher/tests/unit/decision_engine/loading/test_default_strategy_loader.py index db926f569..d46b7b54d 100644 --- a/watcher/tests/decision_engine/loading/test_default_strategy_loader.py +++ b/watcher/tests/unit/decision_engine/loading/test_default_strategy_loader.py @@ -19,7 +19,7 @@ from unittest import mock from watcher.common import exception from watcher.decision_engine.loading import default as default_loading from watcher.decision_engine.strategy.strategies import dummy_strategy -from watcher.tests import base +from watcher.tests.unit import base class TestDefaultStrategyLoader(base.TestCase): diff --git a/watcher/tests/decision_engine/loading/test_goal_loader.py b/watcher/tests/unit/decision_engine/loading/test_goal_loader.py similarity index 98% rename from watcher/tests/decision_engine/loading/test_goal_loader.py rename to watcher/tests/unit/decision_engine/loading/test_goal_loader.py index d4a1bd881..ab5d78963 100644 --- a/watcher/tests/decision_engine/loading/test_goal_loader.py +++ b/watcher/tests/unit/decision_engine/loading/test_goal_loader.py @@ -19,7 +19,7 @@ from unittest import mock from watcher.common import exception from watcher.decision_engine.goal import goals from watcher.decision_engine.loading import default as default_loading -from watcher.tests import base +from watcher.tests.unit import base class TestDefaultGoalLoader(base.TestCase): diff --git a/watcher/tests/decision_engine/messaging/__init__.py b/watcher/tests/unit/decision_engine/messaging/__init__.py similarity index 100% rename from watcher/tests/decision_engine/messaging/__init__.py rename to watcher/tests/unit/decision_engine/messaging/__init__.py diff --git a/watcher/tests/decision_engine/messaging/test_audit_endpoint.py b/watcher/tests/unit/decision_engine/messaging/test_audit_endpoint.py similarity index 94% rename from watcher/tests/decision_engine/messaging/test_audit_endpoint.py rename to watcher/tests/unit/decision_engine/messaging/test_audit_endpoint.py index 74b970e9a..12041d7f5 100644 --- a/watcher/tests/decision_engine/messaging/test_audit_endpoint.py +++ b/watcher/tests/unit/decision_engine/messaging/test_audit_endpoint.py @@ -19,9 +19,9 @@ from watcher.decision_engine.audit import continuous as continuous_handler from watcher.decision_engine.audit import oneshot as oneshot_handler from watcher.decision_engine.messaging import audit_endpoint from watcher.decision_engine.model.collector import manager -from watcher.tests.db import base -from watcher.tests.decision_engine.model import faker_cluster_state -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 +from watcher.tests.unit.objects import utils as obj_utils class TestAuditEndpoint(base.DbTestCase): diff --git a/watcher/tests/decision_engine/messaging/test_data_model_endpoint.py b/watcher/tests/unit/decision_engine/messaging/test_data_model_endpoint.py similarity index 100% rename from watcher/tests/decision_engine/messaging/test_data_model_endpoint.py rename to watcher/tests/unit/decision_engine/messaging/test_data_model_endpoint.py diff --git a/watcher/tests/decision_engine/model/__init__.py b/watcher/tests/unit/decision_engine/model/__init__.py similarity index 100% rename from watcher/tests/decision_engine/model/__init__.py rename to watcher/tests/unit/decision_engine/model/__init__.py diff --git a/watcher/tests/decision_engine/model/data/ironic_scenario_1.xml b/watcher/tests/unit/decision_engine/model/data/ironic_scenario_1.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/ironic_scenario_1.xml rename to watcher/tests/unit/decision_engine/model/data/ironic_scenario_1.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_1.xml b/watcher/tests/unit/decision_engine/model/data/scenario_1.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_1.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_1.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_10.xml b/watcher/tests/unit/decision_engine/model/data/scenario_10.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_10.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_10.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_11_with_1_node_no_instance.xml b/watcher/tests/unit/decision_engine/model/data/scenario_11_with_1_node_no_instance.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_11_with_1_node_no_instance.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_11_with_1_node_no_instance.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_11_with_2_nodes_2_instances.xml b/watcher/tests/unit/decision_engine/model/data/scenario_11_with_2_nodes_2_instances.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_11_with_2_nodes_2_instances.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_11_with_2_nodes_2_instances.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_1_with_1_node_unavailable.xml b/watcher/tests/unit/decision_engine/model/data/scenario_1_with_1_node_unavailable.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_1_with_1_node_unavailable.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_1_with_1_node_unavailable.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_1_with_all_instances_exclude.xml b/watcher/tests/unit/decision_engine/model/data/scenario_1_with_all_instances_exclude.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_1_with_all_instances_exclude.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_1_with_all_instances_exclude.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml b/watcher/tests/unit/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_1_with_all_nodes_disable.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_1_with_metrics.xml b/watcher/tests/unit/decision_engine/model/data/scenario_1_with_metrics.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_1_with_metrics.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_1_with_metrics.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_2_with_metrics.xml b/watcher/tests/unit/decision_engine/model/data/scenario_2_with_metrics.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_2_with_metrics.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_2_with_metrics.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_3_with_2_nodes.xml b/watcher/tests/unit/decision_engine/model/data/scenario_3_with_2_nodes.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_3_with_2_nodes.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_3_with_2_nodes.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_3_with_metrics.xml b/watcher/tests/unit/decision_engine/model/data/scenario_3_with_metrics.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_3_with_metrics.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_3_with_metrics.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_4_with_1_node_no_instance.xml b/watcher/tests/unit/decision_engine/model/data/scenario_4_with_1_node_no_instance.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_4_with_1_node_no_instance.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_4_with_1_node_no_instance.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_5_with_instance_disk_0.xml b/watcher/tests/unit/decision_engine/model/data/scenario_5_with_instance_disk_0.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_5_with_instance_disk_0.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_5_with_instance_disk_0.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_6_with_2_nodes.xml b/watcher/tests/unit/decision_engine/model/data/scenario_6_with_2_nodes.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_6_with_2_nodes.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_6_with_2_nodes.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_7_with_2_nodes.xml b/watcher/tests/unit/decision_engine/model/data/scenario_7_with_2_nodes.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_7_with_2_nodes.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_7_with_2_nodes.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_8_with_4_nodes.xml b/watcher/tests/unit/decision_engine/model/data/scenario_8_with_4_nodes.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_8_with_4_nodes.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_8_with_4_nodes.xml diff --git a/watcher/tests/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml b/watcher/tests/unit/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml rename to watcher/tests/unit/decision_engine/model/data/scenario_9_with_3_active_plus_1_disabled_nodes.xml diff --git a/watcher/tests/decision_engine/model/data/storage_scenario_1.xml b/watcher/tests/unit/decision_engine/model/data/storage_scenario_1.xml similarity index 100% rename from watcher/tests/decision_engine/model/data/storage_scenario_1.xml rename to watcher/tests/unit/decision_engine/model/data/storage_scenario_1.xml diff --git a/watcher/tests/decision_engine/model/faker_cluster_and_metrics.py b/watcher/tests/unit/decision_engine/model/faker_cluster_and_metrics.py similarity index 100% rename from watcher/tests/decision_engine/model/faker_cluster_and_metrics.py rename to watcher/tests/unit/decision_engine/model/faker_cluster_and_metrics.py diff --git a/watcher/tests/decision_engine/model/faker_cluster_state.py b/watcher/tests/unit/decision_engine/model/faker_cluster_state.py similarity index 100% rename from watcher/tests/decision_engine/model/faker_cluster_state.py rename to watcher/tests/unit/decision_engine/model/faker_cluster_state.py diff --git a/watcher/tests/decision_engine/model/gnocchi_metrics.py b/watcher/tests/unit/decision_engine/model/gnocchi_metrics.py similarity index 100% rename from watcher/tests/decision_engine/model/gnocchi_metrics.py rename to watcher/tests/unit/decision_engine/model/gnocchi_metrics.py diff --git a/watcher/tests/decision_engine/model/monasca_metrics.py b/watcher/tests/unit/decision_engine/model/monasca_metrics.py similarity index 100% rename from watcher/tests/decision_engine/model/monasca_metrics.py rename to watcher/tests/unit/decision_engine/model/monasca_metrics.py diff --git a/watcher/tests/decision_engine/model/notification/__init__.py b/watcher/tests/unit/decision_engine/model/notification/__init__.py similarity index 100% rename from watcher/tests/decision_engine/model/notification/__init__.py rename to watcher/tests/unit/decision_engine/model/notification/__init__.py diff --git a/watcher/tests/decision_engine/model/notification/data/capacity.json b/watcher/tests/unit/decision_engine/model/notification/data/capacity.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/capacity.json rename to watcher/tests/unit/decision_engine/model/notification/data/capacity.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-create-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-create-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-create-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-create-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-delete-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-delete-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-delete-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-delete-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-live_migration_force_complete-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-live_migration_force_complete-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-live_migration_force_complete-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-live_migration_force_complete-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-live_migration_post-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-live_migration_post-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-live_migration_post-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-live_migration_post-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-lock.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-lock.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-lock.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-lock.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-pause-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-pause-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-pause-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-pause-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-power_off-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-power_off-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-power_off-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-power_off-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-power_on-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-power_on-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-power_on-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-power_on-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-rebuild-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-rebuild-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-rebuild-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-rebuild-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-rescue-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-rescue-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-rescue-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-rescue-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-resize_confirm-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-resize_confirm-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-resize_confirm-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-resize_confirm-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-restore-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-restore-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-restore-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-restore-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-resume-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-resume-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-resume-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-resume-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-shelve-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-shelve-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-shelve-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-shelve-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-shutdown-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-shutdown-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-shutdown-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-shutdown-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-soft_delete-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-soft_delete-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-soft_delete-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-soft_delete-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-suspend-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-suspend-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-suspend-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-suspend-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-unlock.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-unlock.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-unlock.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-unlock.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-unpause-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-unpause-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-unpause-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-unpause-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-unrescue-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-unrescue-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-unrescue-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-unrescue-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-unshelve-end.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-unshelve-end.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-unshelve-end.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-unshelve-end.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-update-2-1.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-update-2-1.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-update-2-1.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-update-2-1.json diff --git a/watcher/tests/decision_engine/model/notification/data/instance-update.json b/watcher/tests/unit/decision_engine/model/notification/data/instance-update.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/instance-update.json rename to watcher/tests/unit/decision_engine/model/notification/data/instance-update.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario3_instance-update.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario3_instance-update.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario3_instance-update.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario3_instance-update.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario3_notfound_instance-update.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario3_notfound_instance-update.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario3_notfound_instance-update.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario3_notfound_instance-update.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario3_notfound_legacy_instance-update.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario3_notfound_legacy_instance-update.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario3_notfound_legacy_instance-update.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario3_notfound_legacy_instance-update.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario3_service-update-disabled.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario3_service-update-disabled.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario3_service-update-disabled.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario3_service-update-disabled.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario3_service-update-enabled.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario3_service-update-enabled.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario3_service-update-enabled.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario3_service-update-enabled.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_bootable-volume-create.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_bootable-volume-create.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_bootable-volume-create.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_bootable-volume-create.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_capacity.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_capacity.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_capacity.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_capacity.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_capacity_node_notfound.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_capacity_node_notfound.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_capacity_node_notfound.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_capacity_node_notfound.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_capacity_pool_notfound.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_capacity_pool_notfound.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_capacity_pool_notfound.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_capacity_pool_notfound.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_error-volume-create.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_error-volume-create.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_error-volume-create.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_error-volume-create.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_volume-attach.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-attach.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_volume-attach.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-attach.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_volume-create.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-create.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_volume-create.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-create.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_volume-create_pool_notfound.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-create_pool_notfound.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_volume-create_pool_notfound.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-create_pool_notfound.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_volume-delete.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-delete.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_volume-delete.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-delete.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_volume-detach.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-detach.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_volume-detach.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-detach.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_volume-resize.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-resize.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_volume-resize.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-resize.json diff --git a/watcher/tests/decision_engine/model/notification/data/scenario_1_volume-update.json b/watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-update.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/scenario_1_volume-update.json rename to watcher/tests/unit/decision_engine/model/notification/data/scenario_1_volume-update.json diff --git a/watcher/tests/decision_engine/model/notification/data/service-create.json b/watcher/tests/unit/decision_engine/model/notification/data/service-create.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/service-create.json rename to watcher/tests/unit/decision_engine/model/notification/data/service-create.json diff --git a/watcher/tests/decision_engine/model/notification/data/service-delete.json b/watcher/tests/unit/decision_engine/model/notification/data/service-delete.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/service-delete.json rename to watcher/tests/unit/decision_engine/model/notification/data/service-delete.json diff --git a/watcher/tests/decision_engine/model/notification/data/service-update.json b/watcher/tests/unit/decision_engine/model/notification/data/service-update.json similarity index 100% rename from watcher/tests/decision_engine/model/notification/data/service-update.json rename to watcher/tests/unit/decision_engine/model/notification/data/service-update.json diff --git a/watcher/tests/decision_engine/model/notification/fake_managers.py b/watcher/tests/unit/decision_engine/model/notification/fake_managers.py similarity index 96% rename from watcher/tests/decision_engine/model/notification/fake_managers.py rename to watcher/tests/unit/decision_engine/model/notification/fake_managers.py index 693b3b376..7f2cbd5c7 100644 --- a/watcher/tests/decision_engine/model/notification/fake_managers.py +++ b/watcher/tests/unit/decision_engine/model/notification/fake_managers.py @@ -18,7 +18,7 @@ from watcher.common import service_manager from watcher.decision_engine.model.notification import cinder as cnotification from watcher.decision_engine.model.notification import nova as novanotification -from watcher.tests.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.model import faker_cluster_state class FakeManager(service_manager.ServiceManager): diff --git a/watcher/tests/decision_engine/model/notification/test_cinder_notifications.py b/watcher/tests/unit/decision_engine/model/notification/test_cinder_notifications.py similarity index 99% rename from watcher/tests/decision_engine/model/notification/test_cinder_notifications.py rename to watcher/tests/unit/decision_engine/model/notification/test_cinder_notifications.py index 2802162f8..290f549b3 100644 --- a/watcher/tests/decision_engine/model/notification/test_cinder_notifications.py +++ b/watcher/tests/unit/decision_engine/model/notification/test_cinder_notifications.py @@ -25,10 +25,10 @@ from watcher.common import exception from watcher.common import service as watcher_service from watcher.db.sqlalchemy import api as db_api from watcher.decision_engine.model.notification import cinder as cnotification -from watcher.tests import base as base_test -from watcher.tests.db import utils -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.model.notification import fake_managers +from watcher.tests.unit import base as base_test +from watcher.tests.unit.db import utils +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.model.notification import fake_managers class NotificationTestCase(base_test.TestCase): diff --git a/watcher/tests/decision_engine/model/notification/test_notifications.py b/watcher/tests/unit/decision_engine/model/notification/test_notifications.py similarity index 96% rename from watcher/tests/decision_engine/model/notification/test_notifications.py rename to watcher/tests/unit/decision_engine/model/notification/test_notifications.py index 71dd342f5..214199166 100644 --- a/watcher/tests/decision_engine/model/notification/test_notifications.py +++ b/watcher/tests/unit/decision_engine/model/notification/test_notifications.py @@ -24,8 +24,8 @@ from watcher.common import context from watcher.common import service as watcher_service from watcher.decision_engine.model.notification import base from watcher.decision_engine.model.notification import filtering -from watcher.tests import base as base_test -from watcher.tests.decision_engine.model.notification import fake_managers +from watcher.tests.unit import base as base_test +from watcher.tests.unit.decision_engine.model.notification import fake_managers class DummyManager(fake_managers.FakeManager): diff --git a/watcher/tests/decision_engine/model/notification/test_nova_notifications.py b/watcher/tests/unit/decision_engine/model/notification/test_nova_notifications.py similarity index 99% rename from watcher/tests/decision_engine/model/notification/test_nova_notifications.py rename to watcher/tests/unit/decision_engine/model/notification/test_nova_notifications.py index b18da1d70..e0e0f2f82 100644 --- a/watcher/tests/decision_engine/model/notification/test_nova_notifications.py +++ b/watcher/tests/unit/decision_engine/model/notification/test_nova_notifications.py @@ -29,9 +29,9 @@ from watcher.common import placement_helper from watcher.common import service as watcher_service from watcher.decision_engine.model import element from watcher.decision_engine.model.notification import nova as novanotification -from watcher.tests import base as base_test -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.model.notification import fake_managers +from watcher.tests.unit import base as base_test +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.model.notification import fake_managers class NotificationTestCase(base_test.TestCase): diff --git a/watcher/tests/decision_engine/model/test_element.py b/watcher/tests/unit/decision_engine/model/test_element.py similarity index 99% rename from watcher/tests/decision_engine/model/test_element.py rename to watcher/tests/unit/decision_engine/model/test_element.py index 417dd0fae..53791a821 100644 --- a/watcher/tests/decision_engine/model/test_element.py +++ b/watcher/tests/unit/decision_engine/model/test_element.py @@ -16,7 +16,7 @@ # limitations under the License. from watcher.decision_engine.model import element -from watcher.tests import base +from watcher.tests.unit import base class TestElement(base.TestCase): diff --git a/watcher/tests/decision_engine/model/test_model.py b/watcher/tests/unit/decision_engine/model/test_model.py similarity index 99% rename from watcher/tests/decision_engine/model/test_model.py rename to watcher/tests/unit/decision_engine/model/test_model.py index a6e6a9687..008827913 100644 --- a/watcher/tests/decision_engine/model/test_model.py +++ b/watcher/tests/unit/decision_engine/model/test_model.py @@ -23,8 +23,8 @@ from oslo_utils import uuidutils from watcher.common import exception from watcher.decision_engine.model import element from watcher.decision_engine.model import model_root -from watcher.tests import base -from watcher.tests.decision_engine.model import faker_cluster_state +from watcher.tests.unit import base +from watcher.tests.unit.decision_engine.model import faker_cluster_state class TestModel(base.TestCase): diff --git a/watcher/tests/decision_engine/planner/__init__.py b/watcher/tests/unit/decision_engine/planner/__init__.py similarity index 100% rename from watcher/tests/decision_engine/planner/__init__.py rename to watcher/tests/unit/decision_engine/planner/__init__.py diff --git a/watcher/tests/decision_engine/planner/test_node_resource_consolidation.py b/watcher/tests/unit/decision_engine/planner/test_node_resource_consolidation.py similarity index 98% rename from watcher/tests/decision_engine/planner/test_node_resource_consolidation.py rename to watcher/tests/unit/decision_engine/planner/test_node_resource_consolidation.py index 0dc9c7740..35013f576 100644 --- a/watcher/tests/decision_engine/planner/test_node_resource_consolidation.py +++ b/watcher/tests/unit/decision_engine/planner/test_node_resource_consolidation.py @@ -22,9 +22,9 @@ from watcher.decision_engine.planner import \ node_resource_consolidation as pbase from watcher.decision_engine.solution import default as dsol from watcher import objects -from watcher.tests.db import base -from watcher.tests.db import utils as db_utils -from watcher.tests.objects import utils as obj_utils +from watcher.tests.unit.db import base +from watcher.tests.unit.db import utils as db_utils +from watcher.tests.unit.objects import utils as obj_utils class TestActionScheduling(base.DbTestCase): diff --git a/watcher/tests/decision_engine/planner/test_planner_manager.py b/watcher/tests/unit/decision_engine/planner/test_planner_manager.py similarity index 96% rename from watcher/tests/decision_engine/planner/test_planner_manager.py rename to watcher/tests/unit/decision_engine/planner/test_planner_manager.py index 40dc482aa..c0bc85bb8 100644 --- a/watcher/tests/decision_engine/planner/test_planner_manager.py +++ b/watcher/tests/unit/decision_engine/planner/test_planner_manager.py @@ -17,7 +17,7 @@ from oslo_config import cfg from watcher.decision_engine.planner import manager as planner from watcher.decision_engine.planner import weight -from watcher.tests import base +from watcher.tests.unit import base class TestPlannerManager(base.TestCase): diff --git a/watcher/tests/decision_engine/planner/test_weight_planner.py b/watcher/tests/unit/decision_engine/planner/test_weight_planner.py similarity index 99% rename from watcher/tests/decision_engine/planner/test_weight_planner.py rename to watcher/tests/unit/decision_engine/planner/test_weight_planner.py index d3ee4f1de..aa87d30c0 100644 --- a/watcher/tests/decision_engine/planner/test_weight_planner.py +++ b/watcher/tests/unit/decision_engine/planner/test_weight_planner.py @@ -22,11 +22,11 @@ from watcher.decision_engine.planner import weight as pbase from watcher.decision_engine.solution import default as dsol from watcher.decision_engine.strategy import strategies from watcher import objects -from watcher.tests.db import base -from watcher.tests.db import utils as db_utils -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.model import gnocchi_metrics as fake -from watcher.tests.objects import utils as obj_utils +from watcher.tests.unit.db import base +from watcher.tests.unit.db import utils as db_utils +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.model import gnocchi_metrics as fake +from watcher.tests.unit.objects import utils as obj_utils class SolutionFaker: diff --git a/watcher/tests/decision_engine/planner/test_workload_stabilization_planner.py b/watcher/tests/unit/decision_engine/planner/test_workload_stabilization_planner.py similarity index 98% rename from watcher/tests/decision_engine/planner/test_workload_stabilization_planner.py rename to watcher/tests/unit/decision_engine/planner/test_workload_stabilization_planner.py index 6926792c2..36a081dba 100644 --- a/watcher/tests/decision_engine/planner/test_workload_stabilization_planner.py +++ b/watcher/tests/unit/decision_engine/planner/test_workload_stabilization_planner.py @@ -23,11 +23,11 @@ from watcher.decision_engine.planner import workload_stabilization as pbase from watcher.decision_engine.solution import default as dsol from watcher.decision_engine.strategy import strategies from watcher import objects -from watcher.tests.db import base -from watcher.tests.db import utils as db_utils -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.model import gnocchi_metrics as fake -from watcher.tests.objects import utils as obj_utils +from watcher.tests.unit.db import base +from watcher.tests.unit.db import utils as db_utils +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.model import gnocchi_metrics as fake +from watcher.tests.unit.objects import utils as obj_utils class SolutionFaker: diff --git a/watcher/tests/decision_engine/scope/__init__.py b/watcher/tests/unit/decision_engine/scope/__init__.py similarity index 100% rename from watcher/tests/decision_engine/scope/__init__.py rename to watcher/tests/unit/decision_engine/scope/__init__.py diff --git a/watcher/tests/decision_engine/scope/fake_scopes.py b/watcher/tests/unit/decision_engine/scope/fake_scopes.py similarity index 97% rename from watcher/tests/decision_engine/scope/fake_scopes.py rename to watcher/tests/unit/decision_engine/scope/fake_scopes.py index a5f88ec4e..c547234f6 100644 --- a/watcher/tests/decision_engine/scope/fake_scopes.py +++ b/watcher/tests/unit/decision_engine/scope/fake_scopes.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from watcher.tests.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.model import faker_cluster_state vum = faker_cluster_state.volume_uuid_mapping diff --git a/watcher/tests/decision_engine/scope/test_baremetal.py b/watcher/tests/unit/decision_engine/scope/test_baremetal.py similarity index 92% rename from watcher/tests/decision_engine/scope/test_baremetal.py rename to watcher/tests/unit/decision_engine/scope/test_baremetal.py index a41ec5297..5f766eb90 100644 --- a/watcher/tests/decision_engine/scope/test_baremetal.py +++ b/watcher/tests/unit/decision_engine/scope/test_baremetal.py @@ -17,9 +17,9 @@ from unittest import mock from watcher.decision_engine.scope import baremetal -from watcher.tests import base -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.scope import fake_scopes +from watcher.tests.unit import base +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.scope import fake_scopes class TestBaremetalScope(base.TestCase): diff --git a/watcher/tests/decision_engine/scope/test_compute.py b/watcher/tests/unit/decision_engine/scope/test_compute.py similarity index 98% rename from watcher/tests/decision_engine/scope/test_compute.py rename to watcher/tests/unit/decision_engine/scope/test_compute.py index bc75537ba..f502cc658 100644 --- a/watcher/tests/decision_engine/scope/test_compute.py +++ b/watcher/tests/unit/decision_engine/scope/test_compute.py @@ -21,9 +21,9 @@ from watcher.api.controllers.v1 import audit_template from watcher.common import exception from watcher.common import nova_helper from watcher.decision_engine.scope import compute -from watcher.tests import base -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.scope import fake_scopes +from watcher.tests.unit import base +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.scope import fake_scopes class TestComputeScope(base.TestCase): diff --git a/watcher/tests/decision_engine/scope/test_storage.py b/watcher/tests/unit/decision_engine/scope/test_storage.py similarity index 98% rename from watcher/tests/decision_engine/scope/test_storage.py rename to watcher/tests/unit/decision_engine/scope/test_storage.py index 1b7e19d52..59833b739 100644 --- a/watcher/tests/decision_engine/scope/test_storage.py +++ b/watcher/tests/unit/decision_engine/scope/test_storage.py @@ -19,9 +19,9 @@ from unittest import mock from watcher.common import cinder_helper from watcher.common import exception from watcher.decision_engine.scope import storage -from watcher.tests import base -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.scope import fake_scopes +from watcher.tests.unit import base +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.scope import fake_scopes class TestStorageScope(base.TestCase): diff --git a/watcher/tests/decision_engine/scoring/__init__.py b/watcher/tests/unit/decision_engine/scoring/__init__.py similarity index 100% rename from watcher/tests/decision_engine/scoring/__init__.py rename to watcher/tests/unit/decision_engine/scoring/__init__.py diff --git a/watcher/tests/decision_engine/scoring/test_dummy_scorer.py b/watcher/tests/unit/decision_engine/scoring/test_dummy_scorer.py similarity index 98% rename from watcher/tests/decision_engine/scoring/test_dummy_scorer.py rename to watcher/tests/unit/decision_engine/scoring/test_dummy_scorer.py index 34fcfd321..803031c67 100644 --- a/watcher/tests/decision_engine/scoring/test_dummy_scorer.py +++ b/watcher/tests/unit/decision_engine/scoring/test_dummy_scorer.py @@ -18,7 +18,7 @@ from oslo_serialization import jsonutils from watcher.decision_engine.scoring import dummy_scorer -from watcher.tests import base +from watcher.tests.unit import base class TestDummyScorer(base.TestCase): diff --git a/watcher/tests/decision_engine/scoring/test_dummy_scoring_container.py b/watcher/tests/unit/decision_engine/scoring/test_dummy_scoring_container.py similarity index 98% rename from watcher/tests/decision_engine/scoring/test_dummy_scoring_container.py rename to watcher/tests/unit/decision_engine/scoring/test_dummy_scoring_container.py index 20dca3fcb..201d23d83 100644 --- a/watcher/tests/decision_engine/scoring/test_dummy_scoring_container.py +++ b/watcher/tests/unit/decision_engine/scoring/test_dummy_scoring_container.py @@ -18,7 +18,7 @@ from oslo_serialization import jsonutils from watcher.decision_engine.scoring import dummy_scoring_container -from watcher.tests import base +from watcher.tests.unit import base class TestDummyScoringContainer(base.TestCase): diff --git a/watcher/tests/decision_engine/scoring/test_scoring_factory.py b/watcher/tests/unit/decision_engine/scoring/test_scoring_factory.py similarity index 98% rename from watcher/tests/decision_engine/scoring/test_scoring_factory.py rename to watcher/tests/unit/decision_engine/scoring/test_scoring_factory.py index 0b6977928..c2b29abf2 100644 --- a/watcher/tests/decision_engine/scoring/test_scoring_factory.py +++ b/watcher/tests/unit/decision_engine/scoring/test_scoring_factory.py @@ -16,7 +16,7 @@ # limitations under the License. from watcher.decision_engine.scoring import scoring_factory -from watcher.tests import base +from watcher.tests.unit import base class TestScoringFactory(base.TestCase): diff --git a/watcher/tests/decision_engine/solution/__init__.py b/watcher/tests/unit/decision_engine/solution/__init__.py similarity index 100% rename from watcher/tests/decision_engine/solution/__init__.py rename to watcher/tests/unit/decision_engine/solution/__init__.py diff --git a/watcher/tests/decision_engine/solution/test_default_solution.py b/watcher/tests/unit/decision_engine/solution/test_default_solution.py similarity index 98% rename from watcher/tests/decision_engine/solution/test_default_solution.py rename to watcher/tests/unit/decision_engine/solution/test_default_solution.py index d302fd7b8..09be3a56f 100644 --- a/watcher/tests/decision_engine/solution/test_default_solution.py +++ b/watcher/tests/unit/decision_engine/solution/test_default_solution.py @@ -17,7 +17,7 @@ from unittest import mock from watcher.decision_engine.solution import default from watcher.decision_engine.strategy import strategies -from watcher.tests import base +from watcher.tests.unit import base class TestDefaultSolution(base.TestCase): diff --git a/watcher/tests/decision_engine/strategy/__init__.py b/watcher/tests/unit/decision_engine/strategy/__init__.py similarity index 100% rename from watcher/tests/decision_engine/strategy/__init__.py rename to watcher/tests/unit/decision_engine/strategy/__init__.py diff --git a/watcher/tests/decision_engine/strategy/context/__init__.py b/watcher/tests/unit/decision_engine/strategy/context/__init__.py similarity index 100% rename from watcher/tests/decision_engine/strategy/context/__init__.py rename to watcher/tests/unit/decision_engine/strategy/context/__init__.py diff --git a/watcher/tests/decision_engine/strategy/context/test_strategy_context.py b/watcher/tests/unit/decision_engine/strategy/context/test_strategy_context.py similarity index 95% rename from watcher/tests/decision_engine/strategy/context/test_strategy_context.py rename to watcher/tests/unit/decision_engine/strategy/context/test_strategy_context.py index 0d02166a3..1a4f32e06 100644 --- a/watcher/tests/decision_engine/strategy/context/test_strategy_context.py +++ b/watcher/tests/unit/decision_engine/strategy/context/test_strategy_context.py @@ -21,9 +21,9 @@ from watcher.decision_engine.solution import default from watcher.decision_engine.strategy.context import default as d_strategy_ctx from watcher.decision_engine.strategy.selection import default as d_selector from watcher.decision_engine.strategy import strategies -from watcher.tests.db import base -from watcher.tests.decision_engine.model import faker_cluster_state -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 +from watcher.tests.unit.objects import utils as obj_utils class TestStrategyContext(base.DbTestCase): diff --git a/watcher/tests/decision_engine/strategy/selector/__init__.py b/watcher/tests/unit/decision_engine/strategy/selector/__init__.py similarity index 100% rename from watcher/tests/decision_engine/strategy/selector/__init__.py rename to watcher/tests/unit/decision_engine/strategy/selector/__init__.py diff --git a/watcher/tests/decision_engine/strategy/selector/test_strategy_selector.py b/watcher/tests/unit/decision_engine/strategy/selector/test_strategy_selector.py similarity index 98% rename from watcher/tests/decision_engine/strategy/selector/test_strategy_selector.py rename to watcher/tests/unit/decision_engine/strategy/selector/test_strategy_selector.py index a3bb49a22..fc928a8e6 100644 --- a/watcher/tests/decision_engine/strategy/selector/test_strategy_selector.py +++ b/watcher/tests/unit/decision_engine/strategy/selector/test_strategy_selector.py @@ -20,7 +20,7 @@ from watcher.decision_engine.loading import default as default_loader from watcher.decision_engine.strategy.selection import ( default as default_selector) from watcher.decision_engine.strategy import strategies -from watcher.tests import base +from watcher.tests.unit import base class TestStrategySelector(base.TestCase): diff --git a/watcher/tests/decision_engine/strategy/strategies/__init__.py b/watcher/tests/unit/decision_engine/strategy/strategies/__init__.py similarity index 100% rename from watcher/tests/decision_engine/strategy/strategies/__init__.py rename to watcher/tests/unit/decision_engine/strategy/strategies/__init__.py diff --git a/watcher/tests/decision_engine/strategy/strategies/test_actuator.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_actuator.py similarity index 94% rename from watcher/tests/decision_engine/strategy/strategies/test_actuator.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_actuator.py index cd2e759e0..a71a283c6 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_actuator.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_actuator.py @@ -17,7 +17,7 @@ from unittest import mock from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_base.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_base.py similarity index 98% rename from watcher/tests/decision_engine/strategy/strategies/test_base.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_base.py index c5ed14ccb..5f0f7ce70 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_base.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_base.py @@ -19,8 +19,8 @@ from watcher.common import exception from watcher.decision_engine.datasources import manager from watcher.decision_engine.model import model_root from watcher.decision_engine.strategy import strategies -from watcher.tests import base -from watcher.tests.decision_engine.model import faker_cluster_state +from watcher.tests.unit import base +from watcher.tests.unit.decision_engine.model import faker_cluster_state try: # Only check availability; tests mock DataSourceManager so this is just diff --git a/watcher/tests/decision_engine/strategy/strategies/test_basic_consolidation.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_basic_consolidation.py similarity index 97% rename from watcher/tests/decision_engine/strategy/strategies/test_basic_consolidation.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_basic_consolidation.py index f70fb48f7..e9d31acf0 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_basic_consolidation.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_basic_consolidation.py @@ -23,9 +23,9 @@ from watcher.applier.loading import default from watcher.common import clients from watcher.decision_engine.model import model_root from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.model import gnocchi_metrics -from watcher.tests.decision_engine.model import monasca_metrics -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import gnocchi_metrics +from watcher.tests.unit.decision_engine.model import monasca_metrics +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_dummy_strategy.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_dummy_strategy.py similarity index 96% rename from watcher/tests/decision_engine/strategy/strategies/test_dummy_strategy.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_dummy_strategy.py index 998e3d7ae..eddb83a9a 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_dummy_strategy.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_dummy_strategy.py @@ -18,7 +18,7 @@ from unittest import mock from watcher.applier.loading import default from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_dummy_with_scorer.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_dummy_with_scorer.py similarity index 96% rename from watcher/tests/decision_engine/strategy/strategies/test_dummy_with_scorer.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_dummy_with_scorer.py index ed8d70d00..128764c4b 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_dummy_with_scorer.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_dummy_with_scorer.py @@ -18,7 +18,7 @@ from unittest import mock from watcher.applier.loading import default from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_host_maintenance.py similarity index 99% rename from watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_host_maintenance.py index 14e24881f..c98aa5c99 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_host_maintenance.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_host_maintenance.py @@ -21,7 +21,7 @@ from unittest import mock from watcher.common import exception from watcher.decision_engine.model import element from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_node_resource_consolidation.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_node_resource_consolidation.py similarity index 99% rename from watcher/tests/decision_engine/strategy/strategies/test_node_resource_consolidation.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_node_resource_consolidation.py index 436cf2d7e..3131c9195 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_node_resource_consolidation.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_node_resource_consolidation.py @@ -20,9 +20,9 @@ from watcher.common import exception from watcher.decision_engine.model import element from watcher.decision_engine.strategy import strategies from watcher import objects -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy -from watcher.tests.objects import utils as obj_utils +from watcher.tests.unit.objects import utils as obj_utils class TestNodeResourceConsolidation(TestBaseStrategy): diff --git a/watcher/tests/decision_engine/strategy/strategies/test_noisy_neighbor.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_noisy_neighbor.py similarity index 97% rename from watcher/tests/decision_engine/strategy/strategies/test_noisy_neighbor.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_noisy_neighbor.py index b05e91b30..f5ba60296 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_noisy_neighbor.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_noisy_neighbor.py @@ -21,8 +21,8 @@ from unittest import mock from watcher.applier.loading import default from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.model import gnocchi_metrics -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import gnocchi_metrics +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_outlet_temp_control.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_outlet_temp_control.py similarity index 96% rename from watcher/tests/decision_engine/strategy/strategies/test_outlet_temp_control.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_outlet_temp_control.py index 33a65da2b..499dd46e6 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_outlet_temp_control.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_outlet_temp_control.py @@ -21,8 +21,8 @@ from unittest import mock from watcher.applier.loading import default from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.model import gnocchi_metrics -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import gnocchi_metrics +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_saving_energy.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_saving_energy.py similarity index 97% rename from watcher/tests/decision_engine/strategy/strategies/test_saving_energy.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_saving_energy.py index 7939e0ffa..5b6d51ac2 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_saving_energy.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_saving_energy.py @@ -20,8 +20,8 @@ from watcher.common import clients from watcher.common.metal_helper import constants as m_constants from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine import fake_metal_helper -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine import fake_metal_helper +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_storage_capacity_balance.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_storage_capacity_balance.py similarity index 98% rename from watcher/tests/decision_engine/strategy/strategies/test_storage_capacity_balance.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_storage_capacity_balance.py index 21a6228d1..71af72311 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_storage_capacity_balance.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_storage_capacity_balance.py @@ -23,8 +23,8 @@ from watcher.common import cinder_helper from watcher.common import clients from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_strategy_endpoint.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_strategy_endpoint.py similarity index 98% rename from watcher/tests/decision_engine/strategy/strategies/test_strategy_endpoint.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_strategy_endpoint.py index ada8bc36e..792205671 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_strategy_endpoint.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_strategy_endpoint.py @@ -16,7 +16,7 @@ from unittest import mock from watcher.decision_engine.strategy.strategies import base as strategy_base -from watcher.tests import base +from watcher.tests.unit import base class TestStrategyEndpoint(base.BaseTestCase): diff --git a/watcher/tests/decision_engine/strategy/strategies/test_uniform_airflow.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_uniform_airflow.py similarity index 98% rename from watcher/tests/decision_engine/strategy/strategies/test_uniform_airflow.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_uniform_airflow.py index caffeb382..93d3c8205 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_uniform_airflow.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_uniform_airflow.py @@ -21,8 +21,8 @@ from unittest import mock from watcher.applier.loading import default from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.model import gnocchi_metrics -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import gnocchi_metrics +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_vm_workload_consolidation.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_vm_workload_consolidation.py similarity index 99% rename from watcher/tests/decision_engine/strategy/strategies/test_vm_workload_consolidation.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_vm_workload_consolidation.py index fb9ef4d07..a51ade4bd 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_vm_workload_consolidation.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_vm_workload_consolidation.py @@ -22,8 +22,8 @@ from unittest import mock from watcher.decision_engine.model import element from watcher.decision_engine.solution.base import BaseSolution from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.model import faker_cluster_and_metrics -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import faker_cluster_and_metrics +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_workload_balance.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_workload_balance.py similarity index 98% rename from watcher/tests/decision_engine/strategy/strategies/test_workload_balance.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_workload_balance.py index 0549522ac..b3ab19142 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_workload_balance.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_workload_balance.py @@ -22,8 +22,8 @@ from watcher.applier.loading import default from watcher.common import utils from watcher.decision_engine.strategy import strategies from watcher.decision_engine.strategy.strategies import workload_balance -from watcher.tests.decision_engine.model import gnocchi_metrics -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import gnocchi_metrics +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_workload_stabilization.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_workload_stabilization.py similarity index 99% rename from watcher/tests/decision_engine/strategy/strategies/test_workload_stabilization.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_workload_stabilization.py index 0296b4b81..3793f9bc6 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_workload_stabilization.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_workload_stabilization.py @@ -21,8 +21,8 @@ from unittest import mock from watcher.common import clients from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.model import gnocchi_metrics -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import gnocchi_metrics +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy diff --git a/watcher/tests/decision_engine/strategy/strategies/test_zone_migration.py b/watcher/tests/unit/decision_engine/strategy/strategies/test_zone_migration.py similarity index 99% rename from watcher/tests/decision_engine/strategy/strategies/test_zone_migration.py rename to watcher/tests/unit/decision_engine/strategy/strategies/test_zone_migration.py index 2b9f538e4..3b56cf08d 100644 --- a/watcher/tests/decision_engine/strategy/strategies/test_zone_migration.py +++ b/watcher/tests/unit/decision_engine/strategy/strategies/test_zone_migration.py @@ -19,8 +19,8 @@ import cinderclient import novaclient from watcher.common import utils from watcher.decision_engine.strategy import strategies -from watcher.tests.decision_engine.model import faker_cluster_state -from watcher.tests.decision_engine.strategy.strategies.test_base \ +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.decision_engine.strategy.strategies.test_base \ import TestBaseStrategy volume_uuid_mapping = faker_cluster_state.volume_uuid_mapping diff --git a/watcher/tests/decision_engine/test_gmr.py b/watcher/tests/unit/decision_engine/test_gmr.py similarity index 97% rename from watcher/tests/decision_engine/test_gmr.py rename to watcher/tests/unit/decision_engine/test_gmr.py index 08d872210..93ab8d392 100644 --- a/watcher/tests/decision_engine/test_gmr.py +++ b/watcher/tests/unit/decision_engine/test_gmr.py @@ -19,7 +19,7 @@ from unittest import mock from watcher.decision_engine import gmr from watcher.decision_engine.model.collector import manager -from watcher.tests import base +from watcher.tests.unit import base class TestGmrPlugin(base.TestCase): diff --git a/watcher/tests/decision_engine/test_rpcapi.py b/watcher/tests/unit/decision_engine/test_rpcapi.py similarity index 98% rename from watcher/tests/decision_engine/test_rpcapi.py rename to watcher/tests/unit/decision_engine/test_rpcapi.py index 544f6ce35..9cf1a1b6a 100644 --- a/watcher/tests/decision_engine/test_rpcapi.py +++ b/watcher/tests/unit/decision_engine/test_rpcapi.py @@ -19,7 +19,7 @@ import oslo_messaging as om from watcher.common import exception from watcher.common import utils from watcher.decision_engine import rpcapi -from watcher.tests import base +from watcher.tests.unit import base class TestDecisionEngineAPI(base.TestCase): diff --git a/watcher/tests/decision_engine/test_scheduling.py b/watcher/tests/unit/decision_engine/test_scheduling.py similarity index 96% rename from watcher/tests/decision_engine/test_scheduling.py rename to watcher/tests/unit/decision_engine/test_scheduling.py index 9003fbe3c..2737584fd 100644 --- a/watcher/tests/decision_engine/test_scheduling.py +++ b/watcher/tests/unit/decision_engine/test_scheduling.py @@ -28,11 +28,11 @@ from watcher.decision_engine import scheduling from watcher.decision_engine.strategy.strategies import dummy_strategy from watcher import notifications from watcher import objects -from watcher.tests import base -from watcher.tests.db import base as db_base -from watcher.tests.decision_engine.model import faker_cluster_state from watcher.tests.fixtures import watcher as watcher_fixtures -from watcher.tests.objects import utils as obj_utils +from watcher.tests.unit import base +from watcher.tests.unit.db import base as db_base +from watcher.tests.unit.decision_engine.model import faker_cluster_state +from watcher.tests.unit.objects import utils as obj_utils class TestCancelOngoingAudits(db_base.DbTestCase): diff --git a/watcher/tests/decision_engine/test_service.py b/watcher/tests/unit/decision_engine/test_service.py similarity index 99% rename from watcher/tests/decision_engine/test_service.py rename to watcher/tests/unit/decision_engine/test_service.py index 3a8e1648d..6a9797b49 100644 --- a/watcher/tests/decision_engine/test_service.py +++ b/watcher/tests/unit/decision_engine/test_service.py @@ -19,7 +19,7 @@ from watcher.decision_engine.audit import continuous as c_handler from watcher.decision_engine import scheduling from watcher.decision_engine import service from watcher.decision_engine import service_monitor -from watcher.tests import base +from watcher.tests.unit import base @mock.patch.object(service_monitor.DecisionEngineMonitor, '__init__', diff --git a/watcher/tests/decision_engine/test_service_monitor.py b/watcher/tests/unit/decision_engine/test_service_monitor.py similarity index 99% rename from watcher/tests/decision_engine/test_service_monitor.py rename to watcher/tests/unit/decision_engine/test_service_monitor.py index 02990d372..9612e4464 100644 --- a/watcher/tests/decision_engine/test_service_monitor.py +++ b/watcher/tests/unit/decision_engine/test_service_monitor.py @@ -24,9 +24,9 @@ from watcher.common import utils as common_utils from watcher.decision_engine import service_monitor from watcher.notifications 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 class TestDecisionEngineMonitor(base.TestCase): diff --git a/watcher/tests/decision_engine/test_sync.py b/watcher/tests/unit/decision_engine/test_sync.py similarity index 99% rename from watcher/tests/decision_engine/test_sync.py rename to watcher/tests/unit/decision_engine/test_sync.py index 9fcd0c831..0af203c65 100644 --- a/watcher/tests/decision_engine/test_sync.py +++ b/watcher/tests/unit/decision_engine/test_sync.py @@ -22,9 +22,9 @@ from watcher.common import utils from watcher.decision_engine.loading import default from watcher.decision_engine import sync from watcher import objects -from watcher.tests.db import base -from watcher.tests.decision_engine import fake_goals -from watcher.tests.decision_engine import fake_strategies +from watcher.tests.unit.db import base +from watcher.tests.unit.decision_engine import fake_goals +from watcher.tests.unit.decision_engine import fake_strategies class TestSyncer(base.DbTestCase): diff --git a/watcher/tests/notifications/__init__.py b/watcher/tests/unit/notifications/__init__.py similarity index 100% rename from watcher/tests/notifications/__init__.py rename to watcher/tests/unit/notifications/__init__.py diff --git a/watcher/tests/notifications/test_action_notification.py b/watcher/tests/unit/notifications/test_action_notification.py similarity index 99% rename from watcher/tests/notifications/test_action_notification.py rename to watcher/tests/unit/notifications/test_action_notification.py index 41e746f91..509077042 100644 --- a/watcher/tests/notifications/test_action_notification.py +++ b/watcher/tests/unit/notifications/test_action_notification.py @@ -21,8 +21,8 @@ from watcher.common import exception from watcher.common import rpc from watcher import notifications from watcher import objects -from watcher.tests.db import base -from watcher.tests.objects import utils +from watcher.tests.unit.db import base +from watcher.tests.unit.objects import utils @freezegun.freeze_time('2016-10-18T09:52:05.219414') @@ -332,7 +332,7 @@ class TestActionNotification(base.DbTestCase): 'function_name': ( 'test_send_action_execution_with_error'), 'module_name': ( - 'watcher.tests.notifications.' + 'watcher.tests.unit.notifications.' 'test_action_notification') }, 'watcher_object.name': 'ExceptionPayload', @@ -466,7 +466,7 @@ class TestActionNotification(base.DbTestCase): 'function_name': ( 'test_send_action_cancel_with_error'), 'module_name': ( - 'watcher.tests.notifications.' + 'watcher.tests.unit.notifications.' 'test_action_notification') }, 'watcher_object.name': 'ExceptionPayload', diff --git a/watcher/tests/notifications/test_action_plan_notification.py b/watcher/tests/unit/notifications/test_action_plan_notification.py similarity index 98% rename from watcher/tests/notifications/test_action_plan_notification.py rename to watcher/tests/unit/notifications/test_action_plan_notification.py index 8b452ef51..fc10f8332 100644 --- a/watcher/tests/notifications/test_action_plan_notification.py +++ b/watcher/tests/unit/notifications/test_action_plan_notification.py @@ -21,8 +21,8 @@ from watcher.common import exception from watcher.common import rpc from watcher import notifications from watcher import objects -from watcher.tests.db import base -from watcher.tests.objects import utils +from watcher.tests.unit.db import base +from watcher.tests.unit.objects import utils @freezegun.freeze_time('2016-10-18T09:52:05.219414') @@ -385,7 +385,8 @@ class TestActionPlanNotification(base.DbTestCase): "exception_message": "TEST", "function_name": ( "test_send_action_plan_action_with_error"), - "module_name": "watcher.tests.notifications." + "module_name": "watcher.tests.unit." + "notifications." "test_action_plan_notification" }, "watcher_object.name": "ExceptionPayload", @@ -552,7 +553,8 @@ class TestActionPlanNotification(base.DbTestCase): "exception_message": "TEST", "function_name": ( "test_send_action_plan_cancel_with_error"), - "module_name": "watcher.tests.notifications." + "module_name": "watcher.tests.unit." + "notifications." "test_action_plan_notification" }, "watcher_object.name": "ExceptionPayload", diff --git a/watcher/tests/notifications/test_audit_notification.py b/watcher/tests/unit/notifications/test_audit_notification.py similarity index 99% rename from watcher/tests/notifications/test_audit_notification.py rename to watcher/tests/unit/notifications/test_audit_notification.py index 4f36270c7..c245c0e26 100644 --- a/watcher/tests/notifications/test_audit_notification.py +++ b/watcher/tests/unit/notifications/test_audit_notification.py @@ -21,8 +21,8 @@ from watcher.common import exception from watcher.common import rpc from watcher import notifications from watcher import objects -from watcher.tests.db import base -from watcher.tests.objects import utils +from watcher.tests.unit.db import base +from watcher.tests.unit.objects import utils @freezegun.freeze_time('2016-10-18T09:52:05.219414') @@ -435,7 +435,8 @@ class TestAuditNotification(base.DbTestCase): "exception_message": "TEST", "function_name": ( "test_send_audit_action_with_error"), - "module_name": "watcher.tests.notifications." + "module_name": "watcher.tests.unit." + "notifications." "test_audit_notification" }, "watcher_object.name": "ExceptionPayload", diff --git a/watcher/tests/notifications/test_notification.py b/watcher/tests/unit/notifications/test_notification.py similarity index 99% rename from watcher/tests/notifications/test_notification.py rename to watcher/tests/unit/notifications/test_notification.py index 47281d49c..0f45835ff 100644 --- a/watcher/tests/notifications/test_notification.py +++ b/watcher/tests/unit/notifications/test_notification.py @@ -22,8 +22,8 @@ from watcher.common import rpc from watcher.notifications import base as notificationbase from watcher.objects import base from watcher.objects import fields as wfields -from watcher.tests import base as testbase -from watcher.tests.objects import test_objects +from watcher.tests.unit import base as testbase +from watcher.tests.unit.objects import test_objects class TestNotificationBase(testbase.TestCase): diff --git a/watcher/tests/notifications/test_service_notifications.py b/watcher/tests/unit/notifications/test_service_notifications.py similarity index 97% rename from watcher/tests/notifications/test_service_notifications.py rename to watcher/tests/unit/notifications/test_service_notifications.py index b7babcf2c..653e2b5b8 100644 --- a/watcher/tests/notifications/test_service_notifications.py +++ b/watcher/tests/unit/notifications/test_service_notifications.py @@ -22,8 +22,8 @@ from oslo_utils import timeutils from watcher.common import rpc from watcher import notifications from watcher.objects import service as w_service -from watcher.tests.db import base -from watcher.tests.objects import utils +from watcher.tests.unit.db import base +from watcher.tests.unit.objects import utils @freezegun.freeze_time('2016-10-18T09:52:05.219414') diff --git a/watcher/tests/objects/__init__.py b/watcher/tests/unit/objects/__init__.py similarity index 100% rename from watcher/tests/objects/__init__.py rename to watcher/tests/unit/objects/__init__.py diff --git a/watcher/tests/objects/test_action.py b/watcher/tests/unit/objects/test_action.py similarity index 99% rename from watcher/tests/objects/test_action.py rename to watcher/tests/unit/objects/test_action.py index f9f2b5ed9..40c94b105 100644 --- a/watcher/tests/objects/test_action.py +++ b/watcher/tests/unit/objects/test_action.py @@ -23,8 +23,8 @@ from watcher.common import utils as c_utils from watcher.db.sqlalchemy import api as db_api from watcher import notifications 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 TestActionObject(base.DbTestCase): diff --git a/watcher/tests/objects/test_action_description.py b/watcher/tests/unit/objects/test_action_description.py similarity index 98% rename from watcher/tests/objects/test_action_description.py rename to watcher/tests/unit/objects/test_action_description.py index d2fa4f479..c10cd12b7 100644 --- a/watcher/tests/objects/test_action_description.py +++ b/watcher/tests/unit/objects/test_action_description.py @@ -20,8 +20,8 @@ from oslo_utils import timeutils from watcher.db.sqlalchemy import api as db_api 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 TestActionDescriptionObject(base.DbTestCase): diff --git a/watcher/tests/objects/test_action_plan.py b/watcher/tests/unit/objects/test_action_plan.py similarity index 99% rename from watcher/tests/objects/test_action_plan.py rename to watcher/tests/unit/objects/test_action_plan.py index d151ac6c9..882a063c9 100644 --- a/watcher/tests/objects/test_action_plan.py +++ b/watcher/tests/unit/objects/test_action_plan.py @@ -24,8 +24,8 @@ from watcher import conf from watcher.db.sqlalchemy import api as db_api from watcher import notifications 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 CONF = conf.CONF diff --git a/watcher/tests/objects/test_audit.py b/watcher/tests/unit/objects/test_audit.py similarity index 99% rename from watcher/tests/objects/test_audit.py rename to watcher/tests/unit/objects/test_audit.py index 2e3df00f9..29edc67de 100644 --- a/watcher/tests/objects/test_audit.py +++ b/watcher/tests/unit/objects/test_audit.py @@ -24,9 +24,9 @@ from watcher.common import utils as w_utils from watcher.db.sqlalchemy import api as db_api from watcher import notifications from watcher import objects -from watcher.tests.db import base -from watcher.tests.db import utils -from watcher.tests.objects import utils as objutils +from watcher.tests.unit.db import base +from watcher.tests.unit.db import utils +from watcher.tests.unit.objects import utils as objutils class TestAuditObject(base.DbTestCase): diff --git a/watcher/tests/objects/test_audit_template.py b/watcher/tests/unit/objects/test_audit_template.py similarity index 99% rename from watcher/tests/objects/test_audit_template.py rename to watcher/tests/unit/objects/test_audit_template.py index 853e795c4..570d45d65 100644 --- a/watcher/tests/objects/test_audit_template.py +++ b/watcher/tests/unit/objects/test_audit_template.py @@ -22,8 +22,8 @@ from watcher.common import exception from watcher.common import utils as w_utils from watcher.db.sqlalchemy import api as db_api 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 TestAuditTemplateObject(base.DbTestCase): diff --git a/watcher/tests/objects/test_efficacy_indicator.py b/watcher/tests/unit/objects/test_efficacy_indicator.py similarity index 98% rename from watcher/tests/objects/test_efficacy_indicator.py rename to watcher/tests/unit/objects/test_efficacy_indicator.py index 7d18bae5e..a20bbc353 100644 --- a/watcher/tests/objects/test_efficacy_indicator.py +++ b/watcher/tests/unit/objects/test_efficacy_indicator.py @@ -17,8 +17,8 @@ from unittest import mock 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 TestEfficacyIndicatorObject(base.DbTestCase): diff --git a/watcher/tests/objects/test_goal.py b/watcher/tests/unit/objects/test_goal.py similarity index 98% rename from watcher/tests/objects/test_goal.py rename to watcher/tests/unit/objects/test_goal.py index cba187024..332baa0be 100644 --- a/watcher/tests/objects/test_goal.py +++ b/watcher/tests/unit/objects/test_goal.py @@ -20,8 +20,8 @@ from oslo_utils import timeutils from watcher.db.sqlalchemy import api as db_api 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 TestGoalObject(base.DbTestCase): diff --git a/watcher/tests/objects/test_objects.py b/watcher/tests/unit/objects/test_objects.py similarity index 99% rename from watcher/tests/objects/test_objects.py rename to watcher/tests/unit/objects/test_objects.py index e38566a33..b63ecb9f2 100644 --- a/watcher/tests/objects/test_objects.py +++ b/watcher/tests/unit/objects/test_objects.py @@ -24,7 +24,7 @@ from oslo_versionedobjects import fixture as object_fixture from watcher.common import context from watcher.objects import base from watcher.objects import fields -from watcher.tests import base as test_base +from watcher.tests.unit import base as test_base gettext.install('watcher') diff --git a/watcher/tests/objects/test_scoring_engine.py b/watcher/tests/unit/objects/test_scoring_engine.py similarity index 98% rename from watcher/tests/objects/test_scoring_engine.py rename to watcher/tests/unit/objects/test_scoring_engine.py index c974b0be4..2dcca49cb 100644 --- a/watcher/tests/objects/test_scoring_engine.py +++ b/watcher/tests/unit/objects/test_scoring_engine.py @@ -20,8 +20,8 @@ from oslo_utils import timeutils from watcher.db.sqlalchemy import api as db_api 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 TestScoringEngineObject(base.DbTestCase): diff --git a/watcher/tests/objects/test_service.py b/watcher/tests/unit/objects/test_service.py similarity index 98% rename from watcher/tests/objects/test_service.py rename to watcher/tests/unit/objects/test_service.py index 9e753de3b..ff2edc722 100644 --- a/watcher/tests/objects/test_service.py +++ b/watcher/tests/unit/objects/test_service.py @@ -20,8 +20,8 @@ from oslo_utils import timeutils from watcher.db.sqlalchemy import api as db_api 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 TestServiceObject(base.DbTestCase): diff --git a/watcher/tests/objects/test_strategy.py b/watcher/tests/unit/objects/test_strategy.py similarity index 98% rename from watcher/tests/objects/test_strategy.py rename to watcher/tests/unit/objects/test_strategy.py index f0df12f2b..654e1eb30 100644 --- a/watcher/tests/objects/test_strategy.py +++ b/watcher/tests/unit/objects/test_strategy.py @@ -19,8 +19,8 @@ from unittest import mock from watcher.common import exception from watcher.db.sqlalchemy import api as db_api 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 TestStrategyObject(base.DbTestCase): diff --git a/watcher/tests/objects/utils.py b/watcher/tests/unit/objects/utils.py similarity index 99% rename from watcher/tests/objects/utils.py rename to watcher/tests/unit/objects/utils.py index 18ec4aa97..ce4f574bc 100644 --- a/watcher/tests/objects/utils.py +++ b/watcher/tests/unit/objects/utils.py @@ -15,7 +15,7 @@ """Watcher object test utilities.""" from watcher import objects -from watcher.tests.db import utils as db_utils +from watcher.tests.unit.db import utils as db_utils def _load_related_objects(context, cls, db_data): diff --git a/watcher/tests/test_threading.py b/watcher/tests/unit/test_threading.py similarity index 99% rename from watcher/tests/test_threading.py rename to watcher/tests/unit/test_threading.py index 6a993b8d0..b180bd742 100644 --- a/watcher/tests/test_threading.py +++ b/watcher/tests/unit/test_threading.py @@ -19,7 +19,7 @@ import futurist from unittest import mock from watcher.decision_engine import threading -from watcher.tests import base +from watcher.tests.unit import base class TestDecisionEngineThreadPool(base.TestCase):