Merge "Add tests on keystone for invalid path requests."

This commit is contained in:
Jenkins
2013年02月28日 03:22:39 +00:00
committed by Gerrit Code Review

View File

@@ -16,7 +16,7 @@
import unittest
from swift.common.middleware import keystoneauth
from swift.common.swob import Request, Response, HTTPForbidden
from swift.common.swob import Request, Response
from swift.common.http import HTTP_FORBIDDEN
@@ -60,6 +60,18 @@ class SwiftAuth(unittest.TestCase):
response_iter = iter([('200 OK', {}, '')])
return keystoneauth.filter_factory({})(FakeApp(response_iter))
def test_invalid_request_authorized(self):
role = self.test_auth.reseller_admin_role
headers = self._get_identity_headers(role=role)
req = self._make_request('/', headers=headers)
resp = req.get_response(self._get_successful_middleware())
self.assertEqual(resp.status_int, 404)
def test_invalid_request_non_authorized(self):
req = self._make_request('/')
resp = req.get_response(self._get_successful_middleware())
self.assertEqual(resp.status_int, 404)
def test_confirmed_identity_is_authorized(self):
role = self.test_auth.reseller_admin_role
headers = self._get_identity_headers(role=role)
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.