~ubuntu-branches/ubuntu/quantal/keystone/quantal-security

« back to all changes in this revision

Viewing changes to tests/test_auth_token_middleware.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-06-22 12:27:50 UTC
  • mto: (35.1.1 quantal-proposed)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: package-import@ubuntu.com-20120622122750-4urdq17en1990apn
Tags: upstream-2012.2~f2~20120622.2353
ImportĀ upstreamĀ versionĀ 2012.2~f2~20120622.2353

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
                    {'name': 'role2'},
44
44
                ],
45
45
            },
 
46
            'serviceCatalog': {}
46
47
        },
47
48
    },
48
49
    'default-tenant-token': {
244
245
        req.headers['X-Auth-Token'] = 'valid-token'
245
246
        body = self.middleware(req.environ, self.start_fake_response)
246
247
        self.assertEqual(self.response_status, 200)
 
248
        self.assertTrue(req.headers.get('X-Service-Catalog'))
247
249
        self.assertEqual(body, ['SUCCESS'])
248
250
 
249
251
    def test_default_tenant_token(self):
313
315
        self.middleware(req.environ, self.start_fake_response)
314
316
        self.assertEqual(len(self.middleware._cache.set_value), 2)
315
317
 
 
318
    def test_nomemcache(self):
 
319
        self.disable_module('memcache')
 
320
 
 
321
        conf = {
 
322
            'admin_token': 'admin_token1',
 
323
            'auth_host': 'keystone.example.com',
 
324
            'auth_port': 1234,
 
325
            'memcache_servers': 'localhost:11211',
 
326
        }
 
327
 
 
328
        auth_token.AuthProtocol(FakeApp(), conf)
 
329
 
 
330
 
316
331
if __name__ == '__main__':
317
332
    import unittest
318
333
    unittest.main()