Пример #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)
Пример #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)
Пример #3
0
 def _get_successful_middleware(self):
     response_iter = iter([('200 OK', {}, '')])
     return keystoneauth.filter_factory({})(FakeApp(response_iter))
Пример #4
0
 def setUp(self):
     self.test_auth = keystoneauth.filter_factory({})(FakeApp())
     self.test_auth.logger = FakeLogger()
Пример #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_")
Пример #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))
Пример #7
0
 def _get_successful_middleware(self):
     response_iter = iter([('200 OK', {}, '')])
     return keystoneauth.filter_factory({})(FakeApp(response_iter))
Пример #8
0
 def setUp(self):
     self.test_auth = keystoneauth.filter_factory({})(FakeApp())
Пример #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_")
Пример #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))
Пример #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)
Пример #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_")