~ubuntu-branches/ubuntu/trusty/heat/trusty-security

« back to all changes in this revision

Viewing changes to heat/tests/test_watch.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-09-08 21:51:19 UTC
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20130908215119-7tcek6gn73275x5k
Tags: upstream-2013.2~b3
ImportĀ upstreamĀ versionĀ 2013.2~b3

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from heat.engine import parser
24
24
from heat.tests.common import HeatTestCase
25
25
from heat.tests import utils
26
 
from heat.tests.utils import dummy_context
27
26
 
28
27
 
29
28
class WatchData(object):
47
46
        # Create a dummy stack in the DB as WatchRule instances
48
47
        # must be associated with a stack
49
48
        utils.setup_dummy_db()
50
 
        ctx = dummy_context()
 
49
        ctx = utils.dummy_context()
51
50
        ctx.auth_token = 'abcd1234'
52
51
        empty_tmpl = {"template": {}}
53
52
        tmpl = parser.Template(empty_tmpl)
64
63
        self.setUpDatabase()
65
64
        self.username = 'watchrule_test_user'
66
65
 
67
 
        self.ctx = dummy_context()
 
66
        self.ctx = utils.dummy_context()
68
67
        self.ctx.auth_token = 'abcd1234'
69
68
 
70
69
        self.m.ReplayAll()
76
75
 
77
76
        if action_expected:
78
77
            dummy_action = DummyAction()
79
 
            self.m.StubOutWithMock(parser.Stack, '__getitem__')
80
 
            parser.Stack.__getitem__(mox.IgnoreArg()
81
 
                                     ).MultipleTimes().AndReturn(dummy_action)
 
78
            self.m.StubOutWithMock(parser.Stack, 'resource_by_refid')
 
79
            parser.Stack.resource_by_refid(mox.IgnoreArg()).\
 
80
                MultipleTimes().AndReturn(dummy_action)
82
81
 
83
82
        self.m.ReplayAll()
84
83