~ubuntu-branches/ubuntu/wily/heat/wily-proposed

« back to all changes in this revision

Viewing changes to heat/tests/autoscaling/test_scaling_policy.py

  • Committer: Package Import Robot
  • Author(s): James Page, Corey Bryant, James Page
  • Date: 2015-03-30 11:11:18 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20150330111118-2qpycylx6swu4yhj
Tags: 2015.1~b3-0ubuntu1
[ Corey Bryant ]
* New upstream milestone release for OpenStack kilo:
  - d/control: Align with upstream dependencies.
  - d/p/sudoers_patch.patch: Rebased.
  - d/p/fix-requirements.patch: Rebased.

[ James Page ]
* d/p/fixup-assert-regex.patch: Tweak test to use assertRegexpMatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
import datetime
15
15
 
16
16
import mock
17
 
from oslo.config import cfg
18
 
from oslo.utils import timeutils
 
17
from oslo_config import cfg
 
18
from oslo_utils import timeutils
 
19
import six
19
20
 
 
21
from heat.common import exception
20
22
from heat.common import template_format
21
23
from heat.engine import scheduler
22
24
from heat.tests.autoscaling import inline_templates
42
44
        self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
43
45
        return rsrc
44
46
 
 
47
    def test_scaling_policy_bad_group(self):
 
48
        t = template_format.parse(inline_templates.as_template_bad_group)
 
49
        stack = utils.parse_stack(t, params=as_params)
 
50
 
 
51
        up_policy = self.create_scaling_policy(t, stack,
 
52
                                               'WebServerScaleUpPolicy')
 
53
 
 
54
        ex = self.assertRaises(exception.ResourceFailure, up_policy.signal)
 
55
        self.assertIn('Alarm WebServerScaleUpPolicy could '
 
56
                      'not find scaling group', six.text_type(ex))
 
57
 
45
58
    def test_scaling_policy_not_alarm_state(self):
46
59
        """If the details don't have 'alarm' then don't progress."""
47
60
        t = template_format.parse(as_template)