diff --git a/watcher/tests/decision_engine/scope/fake_scopes.py b/watcher/tests/decision_engine/scope/fake_scopes.py index aab3cba8d..78e1ffb5d 100644 --- a/watcher/tests/decision_engine/scope/fake_scopes.py +++ b/watcher/tests/decision_engine/scope/fake_scopes.py @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -fake_scope_1 = [{'compute': [{'availability_zones': [{'name': 'AZ1'}]}, +fake_scope_1 = [{'compute': [{'availability_zones': [{'name': 'AZ1'}, + {'name': 'AZ3'}]}, {'exclude': [ {'instances': [ {'uuid': 'INSTANCE_6'}]}, diff --git a/watcher/tests/decision_engine/scope/test_compute.py b/watcher/tests/decision_engine/scope/test_compute.py index f3b01556a..e714b8bac 100644 --- a/watcher/tests/decision_engine/scope/test_compute.py +++ b/watcher/tests/decision_engine/scope/test_compute.py @@ -40,10 +40,13 @@ class TestComputeScope(base.TestCase): mock_zone_list.return_value = [ mock.Mock(zone='AZ{0}'.format(i), host={'Node_{0}'.format(i): {}}) - for i in range(2)] + for i in range(4)] model = compute.ComputeScope(audit_scope, mock.Mock(), osc=mock.Mock()).get_scoped_model(cluster) - expected_edges = [('INSTANCE_2', 'Node_1')] + + # NOTE(adisky):INSTANCE_6 is not excluded from model it will be tagged + # as 'exclude' TRUE, blueprint compute-cdm-include-all-instances + expected_edges = [('INSTANCE_2', 'Node_1'), (u'INSTANCE_6', u'Node_3')] self.assertEqual(sorted(expected_edges), sorted(model.edges())) @mock.patch.object(nova_helper.NovaHelper, 'get_service_list')