diff options
author | Zuul <zuul@review.openstack.org> | 2019-01-09 10:27:03 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2019-01-09 10:27:03 +0000 |
commit | 4bc09580070c5f6afa9ef39a3d9d1641de557589 (patch) | |
tree | eee320970fe89633a3f74711dda9950ee4f033cf /keystonemiddleware/tests/unit | |
parent | 1e1f9717ff67875cb472ec7abc08ac582fc22b56 (diff) | |
parent | 82707e15a5bce8de2d33b1c865c96844c9770580 (diff) | |
download | keystonemiddleware-4bc09580070c5f6afa9ef39a3d9d1641de557589.tar.gz |
Merge "Make sure audit middleware use own context"
Diffstat (limited to 'keystonemiddleware/tests/unit')
-rw-r--r-- | keystonemiddleware/tests/unit/audit/test_audit_api.py | 2 | ||||
-rw-r--r-- | keystonemiddleware/tests/unit/audit/test_audit_middleware.py | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/keystonemiddleware/tests/unit/audit/test_audit_api.py b/keystonemiddleware/tests/unit/audit/test_audit_api.py index 3843d43..e061dbd 100644 --- a/keystonemiddleware/tests/unit/audit/test_audit_api.py +++ b/keystonemiddleware/tests/unit/audit/test_audit_api.py @@ -201,7 +201,7 @@ class AuditApiLogicTest(base.BaseAuditMiddlewareTest): req = webob.Request.blank(url, environ=self.get_environ_header('GET'), remote_addr='192.168.0.1') - req.context = {} + req.environ['audit.context'] = {} middleware = self.create_simple_middleware() middleware._process_request(req) payload = req.environ['cadf_event'].as_dict() diff --git a/keystonemiddleware/tests/unit/audit/test_audit_middleware.py b/keystonemiddleware/tests/unit/audit/test_audit_middleware.py index 39daf55..baf10bf 100644 --- a/keystonemiddleware/tests/unit/audit/test_audit_middleware.py +++ b/keystonemiddleware/tests/unit/audit/test_audit_middleware.py @@ -84,7 +84,7 @@ class AuditMiddlewareTest(base.BaseAuditMiddlewareTest): def test_process_request_fail(self): req = webob.Request.blank('/foo/bar', environ=self.get_environ_header('GET')) - req.context = {} + req.environ['audit.context'] = {} self.create_simple_middleware()._process_request(req) self.assertTrue(self.notifier.notify.called) @@ -92,7 +92,7 @@ class AuditMiddlewareTest(base.BaseAuditMiddlewareTest): def test_process_response_fail(self): req = webob.Request.blank('/foo/bar', environ=self.get_environ_header('GET')) - req.context = {} + req.environ['audit.context'] = {} middleware = self.create_simple_middleware() middleware._process_response(req, webob.response.Response()) @@ -147,7 +147,7 @@ class AuditMiddlewareTest(base.BaseAuditMiddlewareTest): req = webob.Request.blank('/foo/bar', environ=self.get_environ_header('GET')) - req.context = {} + req.environ['audit.context'] = {} self.notifier.notify.side_effect = Exception('error') middleware(req) @@ -155,7 +155,7 @@ class AuditMiddlewareTest(base.BaseAuditMiddlewareTest): req2 = webob.Request.blank('/foo/bar', environ=self.get_environ_header('GET')) - req2.context = {} + req2.environ['audit.context'] = {} self.notifier.reset_mock() middleware._process_response(req2, webob.response.Response()) @@ -179,7 +179,7 @@ class AuditMiddlewareTest(base.BaseAuditMiddlewareTest): req = webob.Request.blank(url, environ=self.get_environ_header('GET'), remote_addr='192.168.0.1') - req.context = {} + req.environ['audit.context'] = {} middleware._process_request(req) payload = req.environ['cadf_event'].as_dict() middleware._process_response(req, None) @@ -197,7 +197,7 @@ class AuditMiddlewareTest(base.BaseAuditMiddlewareTest): req = webob.Request.blank('http://admin_host:8774/v2/' + str(uuid.uuid4()) + '/servers', environ=self.get_environ_header('GET')) - req.context = {} + req.environ['audit.context'] = {} self.assertNotIn('cadf_event', req.environ) self.create_simple_middleware()._process_response(req, |