)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"a0d768d68ddef89913b9d17a7c7df57603660c21","unresolved":false,"context_lines":[{"line_number":12,"context_line":"there\u0027s zero benefit to doing that, make it keep using the one it"},{"line_number":13,"context_line":"has after validation"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch set dds a new pair of tests to the"},{"line_number":16,"context_line":"AuthenticateAgainstKeystoneTests class, which parrot the current"},{"line_number":17,"context_line":"authentication pass/fail tests, but exercise the new code paths"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAAP3%2F%2Fi6E%3D","line":15,"updated":"2013-07-16 19:05:17.000000000","message":"typo \"dds\" \u003d\u003e \"adds\"","commit_id":"967fd672b475f7e1363cce039c68e7aef5c5ad90"}],"novaclient/client.py":[{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"a71344e07c1e4be84ed80f5a45c66653807b8593","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                self.service_catalog \u003d \\"},{"line_number":254,"context_line":"                    service_catalog.ServiceCatalog(body)"},{"line_number":255,"context_line":"                if extract_token:"},{"line_number":256,"context_line":"                    self.auth_token \u003d self.service_catalog.get_token()"},{"line_number":257,"context_line":"                    self.tenant_id \u003d self.service_catalog.get_tenant_id()"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"                management_url \u003d self.service_catalog.url_for("}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAQn%2F%2FQHI%3D","line":256,"updated":"2013-08-03 19:48:10.000000000","message":"if you also remember the token\u0027s expiration here, you can potentially skip the token validation call proposed in this patchset.\n\n99% of the time it\u0027s going to be valid if it\u0027s not expired. 1% of the time it\u0027ll be prematurely revoked and you\u0027ll have to attempt a re-auth with keystone after getting a 401 back from auth_token / compute","commit_id":"b48f5c2cf8bcca81f246da6ce3575d0d1068a897"}],"novaclient/tests/v1_1/test_auth.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"cd564b8a91bedc912dd414ecac63ab014ca1d3df","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        mock_request \u003d mock.Mock(return_value\u003d(auth_response))"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        @mock.patch.object(requests.Session, \"request\", mock_request)"},{"line_number":276,"context_line":"        def test_auth_call():"},{"line_number":277,"context_line":"            cs.client.authenticate()"},{"line_number":278,"context_line":"            headers \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2FhzQ%3D","line":275,"updated":"2013-07-16 22:56:44.000000000","message":"Place the mock on the top-level method definition and eliminate the inner function, please.","commit_id":"b48f5c2cf8bcca81f246da6ce3575d0d1068a897"},{"author":{"_account_id":5280,"name":"Nicolas Simonds","email":"nic@metacloud.com","username":"nicolas.simonds"},"change_message_id":"bedd4593e334dd5ffbf148d7fdee11d9f4d12e8e","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        mock_request \u003d mock.Mock(return_value\u003d(auth_response))"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        @mock.patch.object(requests.Session, \"request\", mock_request)"},{"line_number":276,"context_line":"        def test_auth_call():"},{"line_number":277,"context_line":"            cs.client.authenticate()"},{"line_number":278,"context_line":"            headers \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAQn%2F%2FzXU%3D","line":275,"in_reply_to":"AAAAP3%2F%2FhzQ%3D","updated":"2013-07-23 00:37:15.000000000","message":"This is 100% unapologetically ripped off from the test_authenticate_success() method, in the finest of cargo-cult programming traditions.  If I alter this method to work differently, then the veracity of the results is in question.  Or should both methods be altered?","commit_id":"b48f5c2cf8bcca81f246da6ce3575d0d1068a897"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"50d7a12ef76e947b92279303428feb9af106ec13","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        mock_request \u003d mock.Mock(return_value\u003d(auth_response))"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        @mock.patch.object(requests.Session, \"request\", mock_request)"},{"line_number":276,"context_line":"        def test_auth_call():"},{"line_number":277,"context_line":"            cs.client.authenticate()"},{"line_number":278,"context_line":"            headers \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAQn%2F%2FxFM%3D","line":275,"in_reply_to":"AAAAQn%2F%2FzXU%3D","updated":"2013-07-23 16:09:40.000000000","message":"I would personally prefer that all the tests be rewritten in the style I advocated here :)  But the only code you really have to touch is your own…","commit_id":"b48f5c2cf8bcca81f246da6ce3575d0d1068a897"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"cd564b8a91bedc912dd414ecac63ab014ca1d3df","unresolved":false,"context_lines":[{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        mock_request \u003d mock.Mock(return_value\u003d(auth_response))"},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"        @mock.patch.object(requests.Session, \"request\", mock_request)"},{"line_number":314,"context_line":"        def test_auth_call():"},{"line_number":315,"context_line":"            self.assertRaises(exceptions.Unauthorized, cs.client.authenticate)"},{"line_number":316,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2FhzI%3D","line":313,"updated":"2013-07-16 22:56:44.000000000","message":"Here also, please.","commit_id":"b48f5c2cf8bcca81f246da6ce3575d0d1068a897"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"60365a9d148b1fb2f6abc6347505644b2183e6fe","unresolved":false,"context_lines":[{"line_number":360,"context_line":""},{"line_number":361,"context_line":"        mock_request \u003d mock.Mock(return_value\u003d(auth_response))"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"        @mock.patch.object(requests.Session, \"request\", mock_request)"},{"line_number":364,"context_line":"        def test_auth_call():"},{"line_number":365,"context_line":"            cs.client.authenticate()"},{"line_number":366,"context_line":"            headers \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAQn%2F%2FDFk%3D","line":363,"updated":"2013-08-07 22:47:46.000000000","message":"I still prefer to have the @mock.patch.object() decorator on the test_authenticate_with_token_success() method, rather than using an inner function and calling it.  For that matter, you could use \"with mock.patch.object(…)\" as well.\n\n(femtonit)","commit_id":"ac12b88345e7ce301724b67eed77f910e331f5af"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"44b4dfa97e5d8d9c0744f4d8c067b7b4f841b55a","unresolved":false,"context_lines":[{"line_number":360,"context_line":""},{"line_number":361,"context_line":"        mock_request \u003d mock.Mock(return_value\u003d(auth_response))"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"        @mock.patch.object(requests.Session, \"request\", mock_request)"},{"line_number":364,"context_line":"        def test_auth_call():"},{"line_number":365,"context_line":"            cs.client.authenticate()"},{"line_number":366,"context_line":"            headers \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASX%2F%2F7Eg%3D","line":363,"updated":"2013-08-23 17:42:00.000000000","message":"I *STILL* want this inner function eliminated and the decorator moved onto the test method itself.  If for some reason you really don\u0027t want to put the decorator on the test method (and why?), then I suggest using the context manager option.","commit_id":"4f8610d708103919b0367b02d7a48a9982f40e64"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"866b7582b0c202c4e55e0160b0133de41eb5b5d8","unresolved":false,"context_lines":[{"line_number":360,"context_line":""},{"line_number":361,"context_line":"        mock_request \u003d mock.Mock(return_value\u003d(auth_response))"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"        @mock.patch.object(requests.Session, \"request\", mock_request)"},{"line_number":364,"context_line":"        def test_auth_call():"},{"line_number":365,"context_line":"            cs.client.authenticate()"},{"line_number":366,"context_line":"            headers \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAS3%2F%2FcDE%3D","line":363,"in_reply_to":"AAAAS3%2F%2Fe%2FA%3D","updated":"2013-09-26 16:49:23.000000000","message":"OK, for the purposes of clarifying my original comment, the format I was looking for is something along the lines of:\n\n    class AuthenticateAgainstKeystoneTests(utils.TestCase):\n        ...\n\n        @mock.patch.object(requests.Session, \"request\")\n        def test_authenticate_with_token_success(self, mock_request):\n            ...\n            auth_response \u003d ...\n            mock_request.return_value \u003d auth_response\n            ...\n            cs.client.authenticate()\n            ...\n\nThus, no inner function needed.  And FTR, I\u0027m happy with a context manager-based approach as well.  And yes, restructuring the existing tests to move to the above is definitely outside the scope of your patch, and I would not have wanted you to do anything like that; I was just hoping to get newly-added tests away from this style of decorating inner functions.","commit_id":"4f8610d708103919b0367b02d7a48a9982f40e64"},{"author":{"_account_id":5280,"name":"Nicolas Simonds","email":"nic@metacloud.com","username":"nicolas.simonds"},"change_message_id":"2916499f782f8e8444b56af46672566e3dc4f4ef","unresolved":false,"context_lines":[{"line_number":360,"context_line":""},{"line_number":361,"context_line":"        mock_request \u003d mock.Mock(return_value\u003d(auth_response))"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"        @mock.patch.object(requests.Session, \"request\", mock_request)"},{"line_number":364,"context_line":"        def test_auth_call():"},{"line_number":365,"context_line":"            cs.client.authenticate()"},{"line_number":366,"context_line":"            headers \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAS3%2F%2Fe%2FA%3D","line":363,"in_reply_to":"AAAASX%2F%2F7Eg%3D","updated":"2013-09-25 22:39:18.000000000","message":"The mock_request has to be referenced in the inner method in order for the assertions to work correctly.  I don\u0027t know that what you\u0027re asking for can be done easily, as it doesn\u0027t appear that the reuse of mock_requests instantiations is...safe.\n\nIf you can point me at some prior art that shows how to do this, I can parrot what I see.  Otherwise, this test is functionally identical to other tests, and if restructuring the tests is a genuine concern, they should all be done as a separate bug/issue.","commit_id":"4f8610d708103919b0367b02d7a48a9982f40e64"}]}
