)]}'
{"nova/tests/unit/objects/test_instance_info_cache.py":[{"author":{"_account_id":11428,"name":"Ajaya Agrawal","email":"ajku.agr@gmail.com","username":"ajayaa"},"change_message_id":"0790492aa74f0952aa23f7c7c33aec7682de2341","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            obj.network_info \u003d nwinfo"},{"line_number":105,"context_line":"            obj.save(update_cells\u003dupdate_cells)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            mock_update("},{"line_number":108,"context_line":"                    self.context, uuids.info_instance,"},{"line_number":109,"context_line":"                    {\u0027network_info\u0027: nwinfo.json()})"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a68dd71_0e103d58","line":107,"range":{"start_line":107,"start_character":12,"end_line":107,"end_character":23},"updated":"2016-01-23 17:59:56.000000000","message":"db.instance_info_cache_update returns new_info_cache in the original implementation whereas with mock you are not returning anything in mock_update. Am I missing something?","commit_id":"6c74127ca1606ad2fc2de5ae955d30a046ccf54b"},{"author":{"_account_id":5538,"name":"Rushi Agrawal","email":"rushi.openstack@gmail.com","username":"rushiagr"},"change_message_id":"3599264a753b2a90d811355a3b6dfd3588322ab3","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            obj.network_info \u003d nwinfo"},{"line_number":105,"context_line":"            obj.save(update_cells\u003dupdate_cells)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            mock_update("},{"line_number":108,"context_line":"                    self.context, uuids.info_instance,"},{"line_number":109,"context_line":"                    {\u0027network_info\u0027: nwinfo.json()})"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a68dd71_59d7dd4a","line":107,"range":{"start_line":107,"start_character":12,"end_line":107,"end_character":23},"in_reply_to":"9a68dd71_0e103d58","updated":"2016-01-23 18:26:07.000000000","message":"I\u0027ve specified return_value while defining mock, at line 85. However, I noticed I forgot to add \u0027assert_called_once_with\u0027 here in the line where you added this comment. Fixing that :)","commit_id":"6c74127ca1606ad2fc2de5ae955d30a046ccf54b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"290a98d5e0fb2b2d02364d55d45d6f3e77ebd93c","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                    mock_cells_api.return_value \u003d cells_api"},{"line_number":97,"context_line":"                    # TODO(rushiagr): add an assertcalledwith?"},{"line_number":98,"context_line":"                    # cells_api.instance_info_cache_update_at_top("},{"line_number":99,"context_line":"                    #     self.context, \u0027foo\u0027)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"            obj._context \u003d self.context"},{"line_number":102,"context_line":"            obj.instance_uuid \u003d uuids.info_instance"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a5de9d1_49c3458b","line":99,"range":{"start_line":99,"start_character":44,"end_line":99,"end_character":46},"updated":"2016-02-02 09:23:38.000000000","message":"Here it would not work as it is called from save().\n\nAfter save you can check and with stale object. like in below comments","commit_id":"021dbef9529f593ecf3ab340f5e86023303cb355"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"290a98d5e0fb2b2d02364d55d45d6f3e77ebd93c","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"            obj._context \u003d self.context"},{"line_number":102,"context_line":"            obj.instance_uuid \u003d uuids.info_instance"},{"line_number":103,"context_line":"            obj.network_info \u003d nwinfo"},{"line_number":104,"context_line":"            obj.save(update_cells\u003dupdate_cells)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            mock_update.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a5de9d1_09bd4d02","line":103,"range":{"start_line":103,"start_character":31,"end_line":103,"end_character":37},"updated":"2016-02-02 09:23:38.000000000","message":"make clone here objstale \u003d obj.obj_clone()","commit_id":"021dbef9529f593ecf3ab340f5e86023303cb355"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"290a98d5e0fb2b2d02364d55d45d6f3e77ebd93c","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            mock_update.assert_called_once_with("},{"line_number":107,"context_line":"                self.context, uuids.info_instance,"},{"line_number":108,"context_line":"                    {\u0027network_info\u0027: nwinfo.json()})"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def test_save_with_update_cells_and_compute_cell(self):"},{"line_number":111,"context_line":"        self._save_helper(\u0027compute\u0027, True)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a5de9d1_696e4198","line":108,"range":{"start_line":108,"start_character":48,"end_line":108,"end_character":52},"updated":"2016-02-02 09:23:38.000000000","message":"if update_cells and cell_type \u003d\u003d \u0027compute\u0027:\n                mock_update_at_top.assert_called_once_with(\n                    self.context, objstale)","commit_id":"021dbef9529f593ecf3ab340f5e86023303cb355"},{"author":{"_account_id":5538,"name":"Rushi Agrawal","email":"rushi.openstack@gmail.com","username":"rushiagr"},"change_message_id":"1e8691ee710af407f701b42ae930eea2ad818448","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            mock_update.assert_called_once_with("},{"line_number":107,"context_line":"                self.context, uuids.info_instance,"},{"line_number":108,"context_line":"                    {\u0027network_info\u0027: nwinfo.json()})"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def test_save_with_update_cells_and_compute_cell(self):"},{"line_number":111,"context_line":"        self._save_helper(\u0027compute\u0027, True)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_63e2ba05","line":108,"range":{"start_line":108,"start_character":48,"end_line":108,"end_character":52},"in_reply_to":"7a5de9d1_696e4198","updated":"2016-02-03 15:19:10.000000000","message":"Thanks Ghanshyam. I just looked into InstanceInfoCache.save() method, and found out that only if update_cells is False, the assertion mock_update_at_top.assert_called_once_with(self.context, objstale) holds true, and not when update_cells is True as suggested in the above comment of yours. If update_cells is True, save() creates a new instance of obj by calling obj_clone() itself, which won\u0027t be the same as what we create here by calling obj.obj_clone().\n\nI\u0027ve incorporated your changes, except for \n\n if update_cells and ...\n\nand replaced with \n\n if not update_cells and ..\n\nThanks for the help. Please let me know if we need to test for the scenario where update_cells is True, and a new object is created internally by save() method of InstanceInfoCache.","commit_id":"021dbef9529f593ecf3ab340f5e86023303cb355"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"ce73305794ca95512ab660b8ecdddc061fb3fd6a","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            obj._context \u003d self.context"},{"line_number":95,"context_line":"            obj.instance_uuid \u003d uuids.info_instance"},{"line_number":96,"context_line":"            obj.network_info \u003d nwinfo"},{"line_number":97,"context_line":"            stale_obj \u003d obj.obj_clone()"},{"line_number":98,"context_line":"            obj.save(update_cells\u003dupdate_cells)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"            mock_update.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":3,"id":"5a5ae5dd_be714d46","line":97,"range":{"start_line":97,"start_character":37,"end_line":97,"end_character":39},"updated":"2016-02-05 02:58:54.000000000","message":"this can be removed.","commit_id":"cce7367d6fcb2e96aa6c76b1c95dfd7156fa2e11"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"ce73305794ca95512ab660b8ecdddc061fb3fd6a","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"            if not update_cells and cell_type \u003d\u003d \u0027compute\u0027:"},{"line_number":105,"context_line":"                mock_update_at_top.assert_called_once_with(self.context,"},{"line_number":106,"context_line":"                    stale_obj)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def test_save_with_update_cells_and_compute_cell(self):"},{"line_number":109,"context_line":"        self._save_helper(\u0027compute\u0027, True)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a5ae5dd_fe7b4526","line":106,"range":{"start_line":106,"start_character":20,"end_line":106,"end_character":29},"updated":"2016-02-05 02:58:54.000000000","message":"Yea this will not work. actually obj_clone() does bit by bit copy and their hashcode are always different even with same obj.\nAnd I do not want to mock obj_clone() itself so better we just check expected function is called or not without checking with arg.\n\nThis will work perfectly here-\n\n            if update_cells and cell_type \u003d\u003d \u0027compute\u0027:\n                self.assertTrue(mock_update_at_top.called)","commit_id":"cce7367d6fcb2e96aa6c76b1c95dfd7156fa2e11"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"ce73305794ca95512ab660b8ecdddc061fb3fd6a","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                self.context, uuids.info_instance,"},{"line_number":102,"context_line":"                    {\u0027network_info\u0027: nwinfo.json()})"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"            if not update_cells and cell_type \u003d\u003d \u0027compute\u0027:"},{"line_number":105,"context_line":"                mock_update_at_top.assert_called_once_with(self.context,"},{"line_number":106,"context_line":"                    stale_obj)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def test_save_with_update_cells_and_compute_cell(self):"},{"line_number":109,"context_line":"        self._save_helper(\u0027compute\u0027, True)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a5ae5dd_584cf19d","line":106,"range":{"start_line":104,"start_character":1,"end_line":106,"end_character":30},"updated":"2016-02-05 02:58:54.000000000","message":"instance_info_cache_update_at_top is called only update cell and cell_type is \u0027compute\u0027.\nThis is passing as this condition is not true anytime as non of test is with this condition.","commit_id":"cce7367d6fcb2e96aa6c76b1c95dfd7156fa2e11"}]}
