)]}'
{"nova/tests/unit/virt/xenapi/test_vmops.py":[{"author":{"_account_id":21363,"name":"Gao Yuan","email":"yuan.gao@easystack.cn","username":"gaoyuan"},"change_message_id":"18bf97dbdcf813cd683663297118603f80f2d87e","unresolved":false,"context_lines":[{"line_number":285,"context_line":""},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"class SpawnTestCase(VMOpsTestBase):"},{"line_number":288,"context_line":"    def _add_stub_and_clean_up(self, obj, name):"},{"line_number":289,"context_line":"        patcher \u003d mock.patch.object(obj, name)"},{"line_number":290,"context_line":"        patcher.start()"},{"line_number":291,"context_line":"        self.addCleanup(patcher.stop)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def _stub_out_common(self):"},{"line_number":294,"context_line":"        self._add_stub_and_clean_up(self.vmops, \u0027_ensure_instance_name_unique\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_aa46dabe","line":291,"range":{"start_line":288,"start_character":0,"end_line":291,"end_character":37},"updated":"2017-03-30 07:05:57.000000000","message":"I don\u0027t think this is a very good way. Any one has an idea what should I do?","commit_id":"5178dbb65564c5f4e13014fb5b2c2baa236079cf"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6306dfee14d77439902a958c907eb236b96a91b7","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        self.addCleanup(patcher.stop)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def _stub_out_common(self):"},{"line_number":294,"context_line":"        self._add_stub_and_clean_up(self.vmops, \u0027_ensure_instance_name_unique\u0027)"},{"line_number":295,"context_line":"        self._add_stub_and_clean_up(self.vmops, \u0027_ensure_enough_free_mem\u0027)"},{"line_number":296,"context_line":"        self._add_stub_and_clean_up(self.vmops, \u0027_update_instance_progress\u0027)"},{"line_number":297,"context_line":"        self._add_stub_and_clean_up(vm_utils, \u0027determine_disk_image_type\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfeb2761_6e1a966f","line":294,"range":{"start_line":294,"start_character":13,"end_line":294,"end_character":35},"updated":"2017-04-04 16:19:45.000000000","message":"could you not just use the \u0027stub_out\u0027 function?","commit_id":"5178dbb65564c5f4e13014fb5b2c2baa236079cf"},{"author":{"_account_id":21363,"name":"Gao Yuan","email":"yuan.gao@easystack.cn","username":"gaoyuan"},"change_message_id":"44712ca8800f4471ecbddf131ec5710301d89846","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        self.addCleanup(patcher.stop)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def _stub_out_common(self):"},{"line_number":294,"context_line":"        self._add_stub_and_clean_up(self.vmops, \u0027_ensure_instance_name_unique\u0027)"},{"line_number":295,"context_line":"        self._add_stub_and_clean_up(self.vmops, \u0027_ensure_enough_free_mem\u0027)"},{"line_number":296,"context_line":"        self._add_stub_and_clean_up(self.vmops, \u0027_update_instance_progress\u0027)"},{"line_number":297,"context_line":"        self._add_stub_and_clean_up(vm_utils, \u0027determine_disk_image_type\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f201791_888711b6","line":294,"range":{"start_line":294,"start_character":13,"end_line":294,"end_character":35},"in_reply_to":"dfeb2761_6e1a966f","updated":"2017-06-26 11:06:36.000000000","message":"Short answer, No. \nThe reason is that we need to make assertion for the methods we stub_out, like later in this code, you can see things like \u0027self.vmops._ensure_instance_name_unique.assert_called_once_with(name_label)\u0027. But if we use stub_out, we cannot do the same thing. Unless, maybe I made a mistake about the usage of self.stub_out.","commit_id":"5178dbb65564c5f4e13014fb5b2c2baa236079cf"}]}
