)]}'
{"troveclient/tests/test_v1_shell.py":[{"author":{"_account_id":22608,"name":"zhanggang","email":"zhanggang@cmss.chinamobile.com","username":"zhanggang"},"change_message_id":"3398406ecd1b31ae41c6c93d4d35b3d1e07f9624","unresolved":false,"context_lines":[{"line_number":780,"context_line":"    def test_module_retrieve(self):"},{"line_number":781,"context_line":"        with mock.patch.object(troveclient.v1.modules.Module, \u0027__getattr__\u0027,"},{"line_number":782,"context_line":"                               mock.Mock(return_value\u003d\u00274321\u0027)):"},{"line_number":783,"context_line":"            with mock.patch(\u0027troveclient.v1.instances.open\u0027):"},{"line_number":784,"context_line":"                self.run_command(\u0027module-retrieve 1234\u0027)"},{"line_number":785,"context_line":"                self.assert_called("},{"line_number":786,"context_line":"                    \u0027GET\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_a26b6084","line":783,"range":{"start_line":783,"start_character":58,"end_line":783,"end_character":61},"updated":"2018-07-12 03:07:25.000000000","message":"Not clear understand what the \"troveclient.v1.instaces.open\" mock for. Is this used for mocking  _find_instances. \nAnd I do some test just remove this line, it also pass the py27.","commit_id":"0fc7d9e33d0ec018126b57e43004e2fba4f7ebaa"},{"author":{"_account_id":22608,"name":"zhanggang","email":"zhanggang@cmss.chinamobile.com","username":"zhanggang"},"change_message_id":"b271329a273f7f8bd509dd6e7b83a4b3e44e0688","unresolved":false,"context_lines":[{"line_number":780,"context_line":"    def test_module_retrieve(self):"},{"line_number":781,"context_line":"        with mock.patch.object(troveclient.v1.modules.Module, \u0027__getattr__\u0027,"},{"line_number":782,"context_line":"                               mock.Mock(return_value\u003d\u00274321\u0027)):"},{"line_number":783,"context_line":"            with mock.patch(\u0027troveclient.v1.instances.open\u0027):"},{"line_number":784,"context_line":"                self.run_command(\u0027module-retrieve 1234\u0027)"},{"line_number":785,"context_line":"                self.assert_called("},{"line_number":786,"context_line":"                    \u0027GET\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_48686b87","line":783,"range":{"start_line":783,"start_character":58,"end_line":783,"end_character":61},"in_reply_to":"5f7c97a3_025ed450","updated":"2018-07-12 05:53:02.000000000","message":"Got it, this mock is for the \"open\" in \"with open(full_filename, \u0027wb\u0027) as fh:\". Thanks for the detailed explanation","commit_id":"0fc7d9e33d0ec018126b57e43004e2fba4f7ebaa"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"5c1fbe0b7e7d4cc64b5803e572e3e04f699cf69c","unresolved":false,"context_lines":[{"line_number":780,"context_line":"    def test_module_retrieve(self):"},{"line_number":781,"context_line":"        with mock.patch.object(troveclient.v1.modules.Module, \u0027__getattr__\u0027,"},{"line_number":782,"context_line":"                               mock.Mock(return_value\u003d\u00274321\u0027)):"},{"line_number":783,"context_line":"            with mock.patch(\u0027troveclient.v1.instances.open\u0027):"},{"line_number":784,"context_line":"                self.run_command(\u0027module-retrieve 1234\u0027)"},{"line_number":785,"context_line":"                self.assert_called("},{"line_number":786,"context_line":"                    \u0027GET\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_88ca036d","line":783,"range":{"start_line":783,"start_character":58,"end_line":783,"end_character":61},"in_reply_to":"5f7c97a3_48686b87","updated":"2018-07-12 06:01:17.000000000","message":":) no problem, thanks for helping review on this.","commit_id":"0fc7d9e33d0ec018126b57e43004e2fba4f7ebaa"},{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"08b14ada6fa963eb5b7e65c19e7bb7b549760e66","unresolved":false,"context_lines":[{"line_number":780,"context_line":"    def test_module_retrieve(self):"},{"line_number":781,"context_line":"        with mock.patch.object(troveclient.v1.modules.Module, \u0027__getattr__\u0027,"},{"line_number":782,"context_line":"                               mock.Mock(return_value\u003d\u00274321\u0027)):"},{"line_number":783,"context_line":"            with mock.patch(\u0027troveclient.v1.instances.open\u0027):"},{"line_number":784,"context_line":"                self.run_command(\u0027module-retrieve 1234\u0027)"},{"line_number":785,"context_line":"                self.assert_called("},{"line_number":786,"context_line":"                    \u0027GET\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_025ed450","line":783,"range":{"start_line":783,"start_character":58,"end_line":783,"end_character":61},"in_reply_to":"5f7c97a3_a26b6084","updated":"2018-07-12 03:52:02.000000000","message":"No, the mocking is for the troveclient.v1.instances module and for this test, the \u0027open\u0027 builtin method is only used by Instances.module_retrieve, the procedure of Instances.module_retrieve is:\n\n    * list all modules applied to the instance\n    * write the module content to an file(named by speficied prefix, and the module attributes(name, datastore, datastore_version) for every module returned by the API\n    * return saved modules(the module names and the names of the written file)\n\nSo even though this test is always passing, without the builtin open correctly mocked, we\u0027ll get a tempary file under the repo root directoy(the file name is fixed, as the prefix is not specified, and the \u0027__getattr’ method of troveclient.v1.modules.Module is mocked to return \u00274321\u0027, i.e. \u00274321_4321_4321.dat\u0027).","commit_id":"0fc7d9e33d0ec018126b57e43004e2fba4f7ebaa"}]}
