)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"a060865f889f93cc55aa49a849f4ea93ed44894b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix service_get_log tests"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Regarding Elod\u0027s comment in 924f3a4fa8d84c4d82151888dbbf51d665d4d860 the"},{"line_number":10,"context_line":"tests seem to be invalid and need to be updated."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I633e67efa4869816786011c3d093dc81e177010c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9f560f44_b53b3c37","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":48},"updated":"2020-10-05 17:33:34.000000000","message":"Also I\u0027ve posted the manual run of the tests on the master patch comment[1] to see the wrong mocking and what we are correcting here\n\nhttps://review.opendev.org/#/c/686000/","commit_id":"d680a237e8f80f182c9a3445a7a8e0f4f4d0bd61"}],"cinder/tests/unit/api/contrib/test_services.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"d6233158dd8b8f960f07535815402f236945af58","unresolved":false,"context_lines":[{"line_number":830,"context_line":"        body \u003d {\u0027binary\u0027: constants.API_BINARY, \u0027server\u0027: server_filter}"},{"line_number":831,"context_line":"        req \u003d FakeRequest(version\u003dmv.LOG_LEVEL)"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        log_levels \u003d self.controller._get_log(req\u003dreq, context\u003dmock.sentinel.context, body\u003dbody)"},{"line_number":834,"context_line":"        get_log_mock.assert_called_once_with(req\u003dreq, context\u003dmock.sentinel.context, body\u003dbody)"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"    @ddt.data(None, \u0027\u0027, \u0027*\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf51134e_7d9a1d6e","line":833,"updated":"2020-06-19 15:49:30.000000000","message":"pep8: E501 line too long (96 \u003e 79 characters)","commit_id":"29a7ddb44903d95315f921cdd84c2237b21ee375"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"d6233158dd8b8f960f07535815402f236945af58","unresolved":false,"context_lines":[{"line_number":830,"context_line":"        body \u003d {\u0027binary\u0027: constants.API_BINARY, \u0027server\u0027: server_filter}"},{"line_number":831,"context_line":"        req \u003d FakeRequest(version\u003dmv.LOG_LEVEL)"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        log_levels \u003d self.controller._get_log(req\u003dreq, context\u003dmock.sentinel.context, body\u003dbody)"},{"line_number":834,"context_line":"        get_log_mock.assert_called_once_with(req\u003dreq, context\u003dmock.sentinel.context, body\u003dbody)"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"    @ddt.data(None, \u0027\u0027, \u0027*\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf51134e_9d9f315e","line":833,"updated":"2020-06-19 15:49:30.000000000","message":"pep8: F841 local variable \u0027log_levels\u0027 is assigned to but never used","commit_id":"29a7ddb44903d95315f921cdd84c2237b21ee375"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"d6233158dd8b8f960f07535815402f236945af58","unresolved":false,"context_lines":[{"line_number":831,"context_line":"        req \u003d FakeRequest(version\u003dmv.LOG_LEVEL)"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        log_levels \u003d self.controller._get_log(req\u003dreq, context\u003dmock.sentinel.context, body\u003dbody)"},{"line_number":834,"context_line":"        get_log_mock.assert_called_once_with(req\u003dreq, context\u003dmock.sentinel.context, body\u003dbody)"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"    @ddt.data(None, \u0027\u0027, \u0027*\u0027)"},{"line_number":837,"context_line":"    @mock.patch(\u0027cinder.objects.ServiceList.get_all\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf51134e_dd8a4919","line":834,"updated":"2020-06-19 15:49:30.000000000","message":"pep8: E501 line too long (95 \u003e 79 characters)","commit_id":"29a7ddb44903d95315f921cdd84c2237b21ee375"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"fb7a6d2c4b718ccab6d523cd16ec879e3745e331","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                          self.controller._get_log, req, self.context,"},{"line_number":825,"context_line":"                          body\u003dbody)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    @mock.patch(\u0027cinder.api.contrib.services.ServiceController._get_log\u0027)"},{"line_number":828,"context_line":"    def test_get_log_w_server_filter_called(self, get_log_mock):"},{"line_number":829,"context_line":"        server_filter \u003d \u0027controller-0\u0027"},{"line_number":830,"context_line":"        body \u003d {\u0027binary\u0027: constants.API_BINARY, \u0027server\u0027: server_filter}"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_1d45fc43","line":827,"range":{"start_line":827,"start_character":17,"end_line":827,"end_character":71},"updated":"2020-08-18 12:06:17.000000000","message":"This is fishy. You mock exactly that method that you want to test. So this should be removed, to test really the _get_log() method.","commit_id":"e608bebe368d10eda06b20d80248d12ea5c61352"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"1befc8dd0552825e9ffc5488c519fa775f02a7a4","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                          self.controller._get_log, req, self.context,"},{"line_number":825,"context_line":"                          body\u003dbody)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    @mock.patch(\u0027cinder.api.contrib.services.ServiceController._get_log\u0027)"},{"line_number":828,"context_line":"    def test_get_log_w_server_filter_called(self, get_log_mock):"},{"line_number":829,"context_line":"        server_filter \u003d \u0027controller-0\u0027"},{"line_number":830,"context_line":"        body \u003d {\u0027binary\u0027: constants.API_BINARY, \u0027server\u0027: server_filter}"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_aa7d9b1d","line":827,"range":{"start_line":827,"start_character":17,"end_line":827,"end_character":71},"in_reply_to":"9f560f44_1d45fc43","updated":"2020-08-19 00:45:15.000000000","message":"In this test, we are just checking if the method is called with the right parameters, the testing with actual call is done in the methods below which call the get_log method with same and different hosts","commit_id":"e608bebe368d10eda06b20d80248d12ea5c61352"},{"author":{"_account_id":20813,"name":"Sofia Enriquez","email":"lsofia.enriquez@gmail.com","username":"enriquetaso"},"change_message_id":"e3f5f2986b3dfed80bd49b4359be4763308cafba","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                          self.controller._get_log, req, self.context,"},{"line_number":825,"context_line":"                          body\u003dbody)"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"    @mock.patch(\u0027cinder.api.contrib.services.ServiceController._get_log\u0027)"},{"line_number":828,"context_line":"    def test_get_log_w_server_filter_called(self, get_log_mock):"},{"line_number":829,"context_line":"        server_filter \u003d \u0027controller-0\u0027"},{"line_number":830,"context_line":"        body \u003d {\u0027binary\u0027: constants.API_BINARY, \u0027server\u0027: server_filter}"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_b6c97879","line":827,"range":{"start_line":827,"start_character":17,"end_line":827,"end_character":71},"in_reply_to":"9f560f44_aa7d9b1d","updated":"2020-08-19 16:25:55.000000000","message":"I agree w Rajat. This test is a simple unittest.mock. After performing an action, make assertions about which methods / attributes were used and arguments they were called with.","commit_id":"e608bebe368d10eda06b20d80248d12ea5c61352"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"f1844ff8cd477b203b3000827290217d7d3a0879","unresolved":false,"context_lines":[{"line_number":830,"context_line":"        body \u003d {\u0027binary\u0027: constants.API_BINARY, \u0027server\u0027: server_filter}"},{"line_number":831,"context_line":"        req \u003d FakeRequest(version\u003dmv.LOG_LEVEL)"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        self.controller._get_log(req\u003dreq, context\u003dmock.sentinel.context,"},{"line_number":834,"context_line":"                                 body\u003dbody)"},{"line_number":835,"context_line":"        get_log_mock.assert_called_once_with("},{"line_number":836,"context_line":"            req\u003dreq, context\u003dmock.sentinel.context, body\u003dbody)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_2114044e","line":833,"range":{"start_line":833,"start_character":8,"end_line":833,"end_character":32},"updated":"2020-08-19 17:50:41.000000000","message":"This is actually the get_lock_mock. So what happens here is you call\n\nget_lock_mock(xx, yy, zz)\n\nThen you assert that get_log_mock was called with \u0027xx, yy, zz\u0027 which you did just one line above in this test, so it passes.\n\nI don\u0027t think this is a valid test case. This just exercises the mock module.","commit_id":"e608bebe368d10eda06b20d80248d12ea5c61352"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d6a9019255b2a93d917ceedc3e4a4277a1b41f66","unresolved":false,"context_lines":[{"line_number":830,"context_line":"        body \u003d {\u0027binary\u0027: constants.API_BINARY, \u0027server\u0027: server_filter}"},{"line_number":831,"context_line":"        req \u003d FakeRequest(version\u003dmv.LOG_LEVEL)"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"        self.controller._get_log(req\u003dreq, context\u003dmock.sentinel.context,"},{"line_number":834,"context_line":"                                 body\u003dbody)"},{"line_number":835,"context_line":"        get_log_mock.assert_called_once_with("},{"line_number":836,"context_line":"            req\u003dreq, context\u003dmock.sentinel.context, body\u003dbody)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_1c99636d","line":833,"range":{"start_line":833,"start_character":8,"end_line":833,"end_character":32},"in_reply_to":"9f560f44_2114044e","updated":"2020-08-19 18:07:37.000000000","message":"This was added to check _get_log only accepts 3 positional parameters, the req, the context and the body and we can\u0027t call it with more or less than 3 parameters.\nSince this is also checked in other tests, i don\u0027t mind removing this one.","commit_id":"e608bebe368d10eda06b20d80248d12ea5c61352"}]}
