summaryrefslogtreecommitdiff
path: root/heat/tests/test_notifications.py
diff options
context:
space:
mode:
authortengqm <tengqim@cn.ibm.com>2014-11-26 20:01:38 +0800
committertengqm <tengqim@cn.ibm.com>2014-12-04 10:39:31 +0800
commit11dc22a701fd7dbde214360baeb88bc50985d080 (patch)
tree05d97b1dbbbd2cd19407bb7dbe8b9c51ee9e79a6 /heat/tests/test_notifications.py
parent5596e63263170b91512285d9cff210968512ea11 (diff)
downloadheat-11dc22a701fd7dbde214360baeb88bc50985d080.tar.gz
Extract group functions into a utility module.
This patch extracts group checking functions into a dedicated module so that resource implementations are simplified. The module could later be used by the autoscaling engine as well. Change-Id: I99cdd8c9e8fe377e6923ab047a9c2ef08d1defad partial-blueprint: reorg-asg-code partial-blueprint: as-lib
Diffstat (limited to 'heat/tests/test_notifications.py')
-rw-r--r--heat/tests/test_notifications.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/heat/tests/test_notifications.py b/heat/tests/test_notifications.py
index 04fc782c4..115c5a3c5 100644
--- a/heat/tests/test_notifications.py
+++ b/heat/tests/test_notifications.py
@@ -15,6 +15,7 @@ import mock
from oslo.utils import timeutils
from heat.common import exception
+from heat.common import grouputils
from heat.common import template_format
from heat.engine.clients.os import glance
from heat.engine.clients.os import nova
@@ -252,7 +253,7 @@ class ScaleNotificationTest(common.HeatTestCase):
end_capacity=2,
)
group.adjust(1)
- self.assertEqual(2, len(group.get_instance_names()))
+ self.assertEqual(2, grouputils.get_size(group))
mock_notify.assert_has_calls(expected)
expected = self.expected_notifs_calls(group,
@@ -261,7 +262,7 @@ class ScaleNotificationTest(common.HeatTestCase):
end_capacity=1,
)
group.adjust(-1)
- self.assertEqual(1, len(group.get_instance_names()))
+ self.assertEqual(1, grouputils.get_size(group))
mock_notify.assert_has_calls(expected)
@mock.patch('heat.engine.notification.stack.send')
@@ -280,6 +281,6 @@ class ScaleNotificationTest(common.HeatTestCase):
start_capacity=1,
with_error=err_message)
self.assertRaises(exception.Error, group.adjust, 2)
- self.assertEqual(1, len(group.get_instance_names()))
+ self.assertEqual(1, grouputils.get_size(group))
mock_error.assert_has_calls([error])
mock_info.assert_has_calls([info])