~ubuntu-branches/ubuntu/quantal/swift/quantal-updates

« back to all changes in this revision

Viewing changes to test/unit/common/middleware/test_tempauth.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Thierry Carrez (ttx)
  • Date: 2012-01-09 11:26:25 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20120109112625-d7a1056nzxt3kwl4
Tags: 1.4.6~20120112.1660-0ubuntu1
[Chuck Short]
* New upstream release.
* Merged changes from upstream packaging, thanks to Thierry Carrez.
* debian/rules:
  + Remove egg-info on clean.

[Thierry Carrez (ttx)]
* Added usr/bin/swift-recon[-cron] to swift package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
        self.assertEquals(resp.environ['swift.authorize'],
151
151
                          self.test_auth.authorize)
152
152
 
 
153
    def test_override_asked_for_but_not_allowed(self):
 
154
        self.test_auth = \
 
155
            auth.filter_factory({'allow_overrides': 'false'})(FakeApp())
 
156
        req = self._make_request('/v1/AUTH_account',
 
157
                                 environ={'swift.authorize_override': True})
 
158
        resp = req.get_response(self.test_auth)
 
159
        self.assertEquals(resp.status_int, 401)
 
160
        self.assertEquals(resp.environ['swift.authorize'],
 
161
                          self.test_auth.authorize)
 
162
 
 
163
    def test_override_asked_for_and_allowed(self):
 
164
        self.test_auth = \
 
165
            auth.filter_factory({'allow_overrides': 'true'})(FakeApp())
 
166
        req = self._make_request('/v1/AUTH_account',
 
167
                                 environ={'swift.authorize_override': True})
 
168
        resp = req.get_response(self.test_auth)
 
169
        self.assertEquals(resp.status_int, 404)
 
170
        self.assertTrue('swift.authorize' not in resp.environ)
 
171
 
 
172
    def test_override_default_allowed(self):
 
173
        req = self._make_request('/v1/AUTH_account',
 
174
                                 environ={'swift.authorize_override': True})
 
175
        resp = req.get_response(self.test_auth)
 
176
        self.assertEquals(resp.status_int, 404)
 
177
        self.assertTrue('swift.authorize' not in resp.environ)
 
178
 
153
179
    def test_auth_deny_non_reseller_prefix(self):
154
180
        resp = self._make_request('/v1/BLAH_account',
155
181
            headers={'X-Auth-Token': 'BLAH_t'}).get_response(self.test_auth)