~ubuntu-branches/ubuntu/saucy/heat/saucy-updates

« back to all changes in this revision

Viewing changes to heat/tests/test_clouddatabase.py

  • Committer: Package Import Robot
  • Author(s): James Page, Chuck Short, James Page
  • Date: 2013-08-08 15:23:59 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130808152359-9jgqjp23kssvc3x9
Tags: 2013.2~b2.a186.g2b4b248-0ubuntu1
[ Chuck Short ]
* debian/patches/rename-quantumclient.patch: Dropped no longer needed. 
* debian/control: Add python-oslo.sphinx

[ James Page ]
* New upstream snapshot.
* d/watch: Updated to track releases on launchpad.
* d/control: Drop BD in pep8, no longer required.
* d/control,rules: Drop use of openstack-pkg-tools, revert use of xz
  compression for debs.
* d/control,*.config,*.templates,po: Drop use of debconf/dbconfig-common
  to configure heat.
* d/*.upstart: Add upstart configurations for Ubuntu.
* d/p/default-kombu.patch: Switch default messaging from qpid to
  kombu.
* d/p/default-sqlite.patch: Use sqlite as default database option.
* d/control: Add python-ceilometerclient to BD's.
* d/rules: Fail package build for unit test failures.
* d/*.install: Directly install configuration files to /etc/heat.
* d/control: Update VCS locations to ubuntu-server-dev branches.
* d/heat-common.{install,manpages}: Include new binaries and associated
  manpages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from heat.engine.resources.rackspace import clouddatabase
22
22
from heat.openstack.common import uuidutils
23
23
from heat.tests.common import HeatTestCase
 
24
from heat.tests.utils import dummy_context
24
25
from heat.tests.utils import setup_dummy_db
25
26
 
26
27
 
84
85
        stack_name = '%s_stack' % name
85
86
        t = template_format.parse(wp_template)
86
87
        template = parser.Template(t)
87
 
        stack = parser.Stack(None,
 
88
        stack = parser.Stack(dummy_context(),
88
89
                             stack_name,
89
90
                             template,
90
91
                             environment.Environment({'InstanceName': 'Test',
145
146
        self.assertRaises(exception.ResourceNotFound, instance.handle_delete)
146
147
        self.m.VerifyAll()
147
148
 
 
149
    def test_attribute_not_found(self):
 
150
        instance = self._setup_test_clouddbinstance('dbinstance_create')
 
151
        fake_client = self.m.CreateMockAnything()
 
152
        instance.cloud_db().AndReturn(fake_client)
 
153
        fakedbinstance = FakeDBInstance()
 
154
        fake_client.create('Test',
 
155
                           flavor='1GB',
 
156
                           volume='30').AndReturn(fakedbinstance)
 
157
        self.m.ReplayAll()
 
158
        instance.handle_create()
 
159
        self.assertEqual(instance._resolve_attribute('invalid-attrib'), None)
 
160
        self.m.VerifyAll()
 
161
 
148
162
    def test_clouddbinstance_delete(self):
149
163
        instance = self._setup_test_clouddbinstance('dbinstance_delete')
150
164
        fake_client = self.m.CreateMockAnything()