コード例 #1
0
ファイル: test_keystoneauth.py プロジェクト: HoO-Group/swift
 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
ファイル: test_keystoneauth.py プロジェクト: HoO-Group/swift
 def _get_successful_middleware(self):
     response_iter = iter([('200 OK', {}, '')])
     return keystoneauth.filter_factory({})(FakeApp(response_iter))
コード例 #4
0
ファイル: test_keystoneauth.py プロジェクト: HoO-Group/swift
 def setUp(self):
     self.test_auth = keystoneauth.filter_factory({})(FakeApp())
     self.test_auth.logger = FakeLogger()
コード例 #5
0
ファイル: test_keystoneauth.py プロジェクト: HoO-Group/swift
 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
ファイル: test_keystoneauth.py プロジェクト: HoO-Group/swift
 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
ファイル: test_keystoneauth.py プロジェクト: kalrey/swift
 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_")