)]}'
{"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0b02facc9e14cbcbbefed81534508cbfb130437a","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"        instance.host \u003d self.compute.host"},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":"        self.compute._init_instance(self.context, instance)"},{"line_number":1029,"context_line":"        self.assertFalse(mock_get.called)"},{"line_number":1030,"context_line":""},{"line_number":1031,"context_line":"    def test_init_instance_deletes_error_deleting_instance(self):"},{"line_number":1032,"context_line":"        instance \u003d fake_instance.fake_instance_obj("}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_d30d863f","line":1029,"updated":"2016-06-13 02:48:45.000000000","message":"err... what? :) Looks to me like the above original test isn\u0027t actually testing anything at all... at least, it\u0027s not testing that \"init_instance errors when not migrating\"... I\u0027d recommend killing this unit test entirely.","commit_id":"574253925fc234b9e2c3873327b2993570c4123f"},{"author":{"_account_id":19741,"name":"Hieu LE","email":"hieulq2@viettel.com.vn","username":"hieulq"},"change_message_id":"23da83591f5c63c5a564f3c982399cc3255946f6","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"        instance.host \u003d self.compute.host"},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":"        self.compute._init_instance(self.context, instance)"},{"line_number":1029,"context_line":"        self.assertFalse(mock_get.called)"},{"line_number":1030,"context_line":""},{"line_number":1031,"context_line":"    def test_init_instance_deletes_error_deleting_instance(self):"},{"line_number":1032,"context_line":"        instance \u003d fake_instance.fake_instance_obj("}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_a56b4db8","line":1029,"in_reply_to":"7aa08908_d30d863f","updated":"2016-06-13 03:27:26.000000000","message":"Done","commit_id":"574253925fc234b9e2c3873327b2993570c4123f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0b02facc9e14cbcbbefed81534508cbfb130437a","unresolved":false,"context_lines":[{"line_number":1061,"context_line":"            mock_delete.assert_called_once_with(self.context, instance,"},{"line_number":1062,"context_line":"                                                bdms, mock.ANY)"},{"line_number":1063,"context_line":"            mock_load.assert_any_call(\u0027metadata\u0027)"},{"line_number":1064,"context_line":"            mock_load.assert_any_call(\u0027system_metadata\u0027)"},{"line_number":1065,"context_line":"            mock_ids.assert_called_once_with(self.context, instance)"},{"line_number":1066,"context_line":""},{"line_number":1067,"context_line":"    def test_init_instance_resize_prep(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_b30a7a24","line":1064,"updated":"2016-06-13 02:48:45.000000000","message":"The above two assertions are not germane to this unit test and can be removed.","commit_id":"574253925fc234b9e2c3873327b2993570c4123f"},{"author":{"_account_id":19741,"name":"Hieu LE","email":"hieulq2@viettel.com.vn","username":"hieulq"},"change_message_id":"23da83591f5c63c5a564f3c982399cc3255946f6","unresolved":false,"context_lines":[{"line_number":1061,"context_line":"            mock_delete.assert_called_once_with(self.context, instance,"},{"line_number":1062,"context_line":"                                                bdms, mock.ANY)"},{"line_number":1063,"context_line":"            mock_load.assert_any_call(\u0027metadata\u0027)"},{"line_number":1064,"context_line":"            mock_load.assert_any_call(\u0027system_metadata\u0027)"},{"line_number":1065,"context_line":"            mock_ids.assert_called_once_with(self.context, instance)"},{"line_number":1066,"context_line":""},{"line_number":1067,"context_line":"    def test_init_instance_resize_prep(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_a57fcd15","line":1064,"in_reply_to":"7aa08908_b30a7a24","updated":"2016-06-13 03:27:26.000000000","message":"Done","commit_id":"574253925fc234b9e2c3873327b2993570c4123f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0b02facc9e14cbcbbefed81534508cbfb130437a","unresolved":false,"context_lines":[{"line_number":1539,"context_line":"        b \u003d FakeInstance(\u0027456\u0027, \u0027orange\u0027, {\u0027clean_attempts\u0027: \u00273\u0027})"},{"line_number":1540,"context_line":"        c \u003d FakeInstance(\u0027789\u0027, \u0027banana\u0027, {})"},{"line_number":1541,"context_line":""},{"line_number":1542,"context_line":"        mock_get.side_effect \u003d _fake_get"},{"line_number":1543,"context_line":"        mock_delete.side_effect \u003d [True, False]"},{"line_number":1544,"context_line":""},{"line_number":1545,"context_line":"        self.compute._run_pending_deletes({})"}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_13042e16","line":1542,"updated":"2016-06-13 02:48:45.000000000","message":"Do:\n  mock_get.return_value \u003d [a, b, c]\n\nand just do the mock_get.assert_called_once_with() below. That way all the assertions are kept together and the reader of the test doesn\u0027t have to scan back up the method to see what is being asserted ;)","commit_id":"574253925fc234b9e2c3873327b2993570c4123f"},{"author":{"_account_id":19741,"name":"Hieu LE","email":"hieulq2@viettel.com.vn","username":"hieulq"},"change_message_id":"23da83591f5c63c5a564f3c982399cc3255946f6","unresolved":false,"context_lines":[{"line_number":1539,"context_line":"        b \u003d FakeInstance(\u0027456\u0027, \u0027orange\u0027, {\u0027clean_attempts\u0027: \u00273\u0027})"},{"line_number":1540,"context_line":"        c \u003d FakeInstance(\u0027789\u0027, \u0027banana\u0027, {})"},{"line_number":1541,"context_line":""},{"line_number":1542,"context_line":"        mock_get.side_effect \u003d _fake_get"},{"line_number":1543,"context_line":"        mock_delete.side_effect \u003d [True, False]"},{"line_number":1544,"context_line":""},{"line_number":1545,"context_line":"        self.compute._run_pending_deletes({})"}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_c5493933","line":1542,"in_reply_to":"7aa08908_13042e16","updated":"2016-06-13 03:27:26.000000000","message":"Jay, I had tried your recommendation but the fact that our testing method _run_pending_deletes will call utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027).\n\nMock lib can only verify the context after return from our testing method, not the temporary method while mox can do.\n\nThat\u0027s why I do verify mock_get before return the value.","commit_id":"574253925fc234b9e2c3873327b2993570c4123f"}]}
