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

« back to all changes in this revision

Viewing changes to heat/tests/test_s3.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:
20
20
from heat.openstack.common.importutils import try_import
21
21
from heat.engine.resources import s3
22
22
from heat.engine import resource
 
23
from heat.engine import clients
23
24
from heat.engine import scheduler
24
25
from heat.tests.common import HeatTestCase
25
26
from heat.tests import utils
 
27
from heat.tests import fakes
26
28
from heat.tests.utils import setup_dummy_db
27
29
from heat.tests.utils import parse_stack
28
30
 
63
65
        self.m.StubOutWithMock(swiftclient.Connection, 'put_container')
64
66
        self.m.StubOutWithMock(swiftclient.Connection, 'delete_container')
65
67
        self.m.StubOutWithMock(swiftclient.Connection, 'get_auth')
 
68
        self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
66
69
 
67
70
        setup_dummy_db()
68
71
 
75
78
        return rsrc
76
79
 
77
80
    def test_attributes(self):
 
81
        clients.OpenStackClients.keystone().AndReturn(
 
82
            fakes.FakeKeystoneClient())
78
83
        container_name = utils.PhysName('test_stack', 'test_resource')
79
84
        swiftclient.Connection.put_container(
80
85
            container_name,
111
116
        self.m.VerifyAll()
112
117
 
113
118
    def test_public_read(self):
 
119
        clients.OpenStackClients.keystone().AndReturn(
 
120
            fakes.FakeKeystoneClient())
114
121
        container_name = utils.PhysName('test_stack', 'test_resource')
115
122
        swiftclient.Connection.put_container(
116
123
            utils.PhysName('test_stack', 'test_resource'),
129
136
        self.m.VerifyAll()
130
137
 
131
138
    def test_public_read_write(self):
 
139
        clients.OpenStackClients.keystone().AndReturn(
 
140
            fakes.FakeKeystoneClient())
132
141
        container_name = utils.PhysName('test_stack', 'test_resource')
133
142
        swiftclient.Connection.put_container(
134
143
            container_name,
147
156
        self.m.VerifyAll()
148
157
 
149
158
    def test_authenticated_read(self):
 
159
        clients.OpenStackClients.keystone().AndReturn(
 
160
            fakes.FakeKeystoneClient())
150
161
        container_name = utils.PhysName('test_stack', 'test_resource')
151
162
        swiftclient.Connection.put_container(
152
163
            container_name,
164
175
        self.m.VerifyAll()
165
176
 
166
177
    def test_website(self):
 
178
        clients.OpenStackClients.keystone().AndReturn(
 
179
            fakes.FakeKeystoneClient())
167
180
        container_name = utils.PhysName('test_stack', 'test_resource')
168
181
        swiftclient.Connection.put_container(
169
182
            container_name,
181
194
        self.m.VerifyAll()
182
195
 
183
196
    def test_delete_exception(self):
 
197
        clients.OpenStackClients.keystone().AndReturn(
 
198
            fakes.FakeKeystoneClient())
184
199
        container_name = utils.PhysName('test_stack', 'test_resource')
185
200
        swiftclient.Connection.put_container(
186
201
            container_name,
199
214
 
200
215
    def test_delete_retain(self):
201
216
 
 
217
        clients.OpenStackClients.keystone().AndReturn(
 
218
            fakes.FakeKeystoneClient())
202
219
        # first run, with retain policy
203
220
        swiftclient.Connection.put_container(
204
221
            utils.PhysName('test_stack', 'test_resource'),