)]}'
{"trove/tests/api/mgmt/instances_actions.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ed78ecd8e674f1b7b6b71afa3e0050d28b806f84","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                      self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        mock_load.called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                   id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_634bb72a","line":112,"range":{"start_line":112,"start_character":18,"end_line":112,"end_character":34},"updated":"2018-03-12 21:23:08.000000000","message":"assert_called_once_with?","commit_id":"6f6c97e7f3639013de244a464d247e0c9f5229cd"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"1cc11251d1807170b98df1f186e02de9ca169c73","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                      self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        mock_load.called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                   id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_2f303de8","line":112,"range":{"start_line":112,"start_character":18,"end_line":112,"end_character":34},"in_reply_to":"df7087c5_2c292b9a","updated":"2018-03-13 01:20:05.000000000","message":"Done","commit_id":"6f6c97e7f3639013de244a464d247e0c9f5229cd"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"dfd149a1f188b144b4b19e2903416cb3ff1f762a","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                      self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        mock_load.called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                   id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_7d3fcfb3","line":112,"range":{"start_line":112,"start_character":18,"end_line":112,"end_character":34},"in_reply_to":"df7087c5_2f303de8","updated":"2018-03-13 03:02:19.000000000","message":"FYI: If you would like to avoid this kind of mistake, you can use \"with\" clause.\n\n  with mock.patch.object(MgmtInstance, \u0027load\u0027) as mock_load:\n     req, body \u003d self._make_request(context\u003dself.context)\n     self.controller \u003d MgmtInstanceController()\n     resp \u003d self.controller.action(req, body, self.tenant_id,\n                                   self.db_info.id)\n  mock_load.assert_called_once_with(context\u003dself.context,\n                                    id\u003dself.db_info.id)\n\nWhen exiting the \"with\" clause, mocking will be stopped.\nYou can still access \"mock_load\" in this case, so you can call assert methods like assert_called_once_with, but as mocking is already stopped you cannot call other methods.","commit_id":"6f6c97e7f3639013de244a464d247e0c9f5229cd"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"8b575634929b0a067593648b1febab2572dc6325","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                      self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        mock_load.called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                   id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_2c292b9a","line":112,"range":{"start_line":112,"start_character":18,"end_line":112,"end_character":34},"in_reply_to":"df7087c5_634bb72a","updated":"2018-03-13 01:17:49.000000000","message":"Right, thanks.","commit_id":"6f6c97e7f3639013de244a464d247e0c9f5229cd"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"2198bfffbcc2945c4e5a18820b17b891d915c834","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                      self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        mock_load.called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                   id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_fd3d1f8f","line":112,"range":{"start_line":112,"start_character":18,"end_line":112,"end_character":34},"in_reply_to":"df7087c5_7d3fcfb3","updated":"2018-03-13 03:14:50.000000000","message":"Thanks. Yes, I already submitted a patchset v2 by using the \"with\" clause, with a slight difference that the assertion is also inside the \"with\" context.\n\nWould you help reviewing on the new patchset?","commit_id":"6f6c97e7f3639013de244a464d247e0c9f5229cd"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"f6171a0861f60171b739164e7b8fd841a6a3196e","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                          self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            mock_load.assert_called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                              id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @test"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_a040cea6","line":113,"range":{"start_line":112,"start_character":8,"end_line":113,"end_character":65},"updated":"2018-03-13 12:28:20.000000000","message":"it is better to place this out side of the with clause because mocking is stopped when exiting the with clause. This prevents unintended typo of method name.","commit_id":"7ea88b05538edfd725381a68dd3f145ad5bf2ca9"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"c8245c5bcbb1a143ee898d72627fed62047e8a4f","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                          self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            mock_load.assert_called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                              id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @test"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_3b6f9193","line":113,"range":{"start_line":112,"start_character":8,"end_line":113,"end_character":65},"in_reply_to":"df7087c5_61c90a57","updated":"2018-03-19 04:38:27.000000000","message":":), anyway I got the point when I first saw the sentence.","commit_id":"7ea88b05538edfd725381a68dd3f145ad5bf2ca9"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"ebfa784245e775b22820d7e41c12a7fb648c5a19","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                          self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            mock_load.assert_called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                              id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @test"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_ab3f4fb2","line":113,"range":{"start_line":112,"start_character":8,"end_line":113,"end_character":65},"in_reply_to":"df7087c5_a040cea6","updated":"2018-03-13 12:48:54.000000000","message":"Thanks. As mock.patch/mock.patch.object returns a mock object, unintended typos of method name may cannot be easily avoided by put the assertion outside or inside the with clause, and usually mocked object is only used inside the with clause in most OpenStack project unittests code, so I\u0027m not going to change this.","commit_id":"7ea88b05538edfd725381a68dd3f145ad5bf2ca9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"69fdf0d6c630010f797f4fad9c148309229a9482","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                          self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            mock_load.assert_called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                              id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @test"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_ab72ef79","line":113,"range":{"start_line":112,"start_character":8,"end_line":113,"end_character":65},"in_reply_to":"df7087c5_ab3f4fb2","updated":"2018-03-13 12:59:28.000000000","message":"I am a developer who works on trove, so I am okay with either.\nPerhaps most codes places assert methods inside the with clause as most folks thinks a variable can be accessed only inside the with clause as most \u0027with\u0027 clause behaves so. My comment is just to mention the intention of mock design. It is totally up to a project what convention is used.","commit_id":"7ea88b05538edfd725381a68dd3f145ad5bf2ca9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"96ee481a522e855a74092748882aa41e3a320324","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                          self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            mock_load.assert_called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                              id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @test"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_61c90a57","line":113,"range":{"start_line":112,"start_character":8,"end_line":113,"end_character":65},"in_reply_to":"df7087c5_ab72ef79","updated":"2018-03-15 21:51:23.000000000","message":"\u003e I am a developer who works on trove, so I am okay with either.\n\nI am not a developer ....\n\n(I wonder why I forgot \"not\"....)","commit_id":"7ea88b05538edfd725381a68dd3f145ad5bf2ca9"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"b81e2751bd82901cc4802be558fac883d7914e43","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            resp \u003d self.controller.action(req, body, self.tenant_id,"},{"line_number":110,"context_line":"                                          self.db_info.id)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"            mock_load.assert_called_once_with(context\u003dself.context,"},{"line_number":113,"context_line":"                                              id\u003dself.db_info.id)"},{"line_number":114,"context_line":"        return resp"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @test"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_8b960b4c","line":113,"range":{"start_line":112,"start_character":8,"end_line":113,"end_character":65},"in_reply_to":"df7087c5_ab72ef79","updated":"2018-03-13 13:06:59.000000000","message":"Right, thanks a lot for your patient and valuable comments.","commit_id":"7ea88b05538edfd725381a68dd3f145ad5bf2ca9"}]}
