Esempio n. 1
0
 def test_override_asked_for_and_allowed(self):
     conf = {'allow_overrides': 'true'}
     self.test_auth = keystoneauth.filter_factory(conf)(FakeApp())
     req = self._make_request('/v1/AUTH_account',
                              environ={'swift.authorize_override': True})
     resp = req.get_response(self.test_auth)
     self.assertEquals(resp.status_int, 404)
Esempio n. 2
0
 def test_override_asked_for_and_allowed(self):
     conf = {'allow_overrides': 'true'}
     self.test_auth = keystoneauth.filter_factory(conf)(FakeApp())
     req = self._make_request('/v1/AUTH_account',
                              environ={'swift.authorize_override': True})
     resp = req.get_response(self.test_auth)
     self.assertEquals(resp.status_int, 404)
Esempio n. 3
0
 def _get_successful_middleware(self):
     response_iter = iter([('200 OK', {}, '')])
     return keystoneauth.filter_factory({})(FakeApp(response_iter))
Esempio n. 4
0
 def setUp(self):
     self.test_auth = keystoneauth.filter_factory({})(FakeApp())
     self.test_auth.logger = FakeLogger()
Esempio n. 5
0
 def test_reseller_prefix_not_added_double_underscores(self):
     conf = {'reseller_prefix': 'AUTH_'}
     test_auth = keystoneauth.filter_factory(conf)(FakeApp())
     self.assertEqual(test_auth.reseller_prefix, "AUTH_")
Esempio n. 6
0
 def test_blank_reseller_prefix(self):
     conf = {'reseller_prefix': ''}
     test_auth = keystoneauth.filter_factory(conf)(FakeApp())
     account = tenant_id = 'foo'
     self.assertTrue(test_auth._reseller_check(account, tenant_id))
Esempio n. 7
0
 def _get_successful_middleware(self):
     response_iter = iter([('200 OK', {}, '')])
     return keystoneauth.filter_factory({})(FakeApp(response_iter))
Esempio n. 8
0
 def setUp(self):
     self.test_auth = keystoneauth.filter_factory({})(FakeApp())
Esempio n. 9
0
 def test_reseller_prefix_not_added_double_underscores(self):
     conf = {'reseller_prefix': 'AUTH_'}
     test_auth = keystoneauth.filter_factory(conf)(FakeApp())
     self.assertEqual(test_auth.reseller_prefix, "AUTH_")
Esempio n. 10
0
 def test_blank_reseller_prefix(self):
     conf = {'reseller_prefix': ''}
     test_auth = keystoneauth.filter_factory(conf)(FakeApp())
     account = tenant_id = 'foo'
     self.assertTrue(test_auth._reseller_check(account, tenant_id))
Esempio n. 11
0
 def test_override_asked_for_but_not_allowed(self):
     conf = {"allow_overrides": "false"}
     self.test_auth = keystoneauth.filter_factory(conf)(FakeApp())
     req = self._make_request("/v1/AUTH_account", environ={"swift.authorize_override": True})
     resp = req.get_response(self.test_auth)
     self.assertEquals(resp.status_int, 401)
Esempio n. 12
0
 def test_reseller_prefix_added_underscore(self):
     conf = {"reseller_prefix": "AUTH"}
     test_auth = keystoneauth.filter_factory(conf)(FakeApp())
     self.assertEqual(test_auth.reseller_prefix, "AUTH_")