本文整理汇总了Python中swift.common.middleware.keystoneauth.filter_factory函数的典型用法代码示例。如果您正苦于以下问题:Python filter_factory函数的具体用法?Python filter_factory怎么用?Python filter_factory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了filter_factory函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_override_asked_for_and_allowed
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: _get_successful_middleware
def _get_successful_middleware(self):
response_iter = iter([('200 OK', {}, '')])
return keystoneauth.filter_factory({})(FakeApp(response_iter))
示例3: setUp
def setUp(self):
self.test_auth = keystoneauth.filter_factory({})(FakeApp())
self.test_auth.logger = FakeLogger()
示例4: test_reseller_prefix_not_added_double_underscores
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_")
示例5: test_blank_reseller_prefix
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))
示例6: test_override_asked_for_but_not_allowed
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)
示例7: test_reseller_prefix_added_underscore
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_")