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

« back to all changes in this revision

Viewing changes to heat/tests/test_event.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2014-03-06 17:18:51 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20140306171851-2h4id4c4bsh9xl31
Tags: 2014.1~b3-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/adjust-dependencies.patch: Dropped no longer needed.
* debian/control: Add python-troveclient.
* debian/rules: fail to build if testsuite fails.
* debian/patches/use-oslo.sphinx-namespace.patch: Use oslo.sphinx namespace.

[ Adam Gandelman ]
* debian/heat-engine.install: Install /etc/heat/environment.d/*.
  (LP: #1285875).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
1
 
3
2
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
3
#    not use this file except in compliance with the License. You may obtain
124
123
        self.assertEqual('arizona', events[0].physical_resource_id)
125
124
 
126
125
    def test_identifier(self):
 
126
        event_uuid = 'abc123yc-9f88-404d-a85b-531529456xyz'
127
127
        e = event.Event(self.ctx, self.stack, 'TEST', 'IN_PROGRESS', 'Testing',
128
128
                        'wibble', self.resource.properties,
129
 
                        self.resource.name, self.resource.type())
 
129
                        self.resource.name, self.resource.type(),
 
130
                        uuid=event_uuid)
130
131
 
131
 
        eid = e.store()
 
132
        e.store()
132
133
        expected_identifier = {
133
134
            'stack_name': self.stack.name,
134
135
            'stack_id': self.stack.id,
135
136
            'tenant': self.ctx.tenant_id,
136
 
            'path': '/resources/EventTestResource/events/%s' % str(eid)
 
137
            'path': '/resources/EventTestResource/events/%s' % str(event_uuid)
137
138
        }
138
139
        self.assertEqual(expected_identifier, e.identifier())
139
140
 
 
141
    def test_identifier_is_none(self):
 
142
        e = event.Event(self.ctx, self.stack, 'TEST', 'IN_PROGRESS', 'Testing',
 
143
                        'wibble', self.resource.properties,
 
144
                        self.resource.name, self.resource.type())
 
145
 
 
146
        e.store()
 
147
        self.assertIsNone(e.identifier())
 
148
 
140
149
    def test_badprop(self):
141
150
        tmpl = {'Type': 'ResourceWithRequiredProps',
142
151
                'Properties': {'Foo': False}}