)]}'
{"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"352844f3892fd0ebf9641771fbb877529f0cdba9","unresolved":false,"context_lines":[{"line_number":1327,"context_line":""},{"line_number":1328,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_filters\u0027)"},{"line_number":1329,"context_line":"    def test_get_instances_on_driver_empty(self, mock_instance_list):"},{"line_number":1330,"context_line":"        with mock.patch.object(self.compute.driver,"},{"line_number":1331,"context_line":"                               \u0027list_instance_uuids\u0027) as mock_driver_uuids:"},{"line_number":1332,"context_line":"            mock_driver_uuids.return_value \u003d []"},{"line_number":1333,"context_line":"            result \u003d self.compute._get_instances_on_driver(self.context)"},{"line_number":1334,"context_line":"            # Short circuit DB call, get_by_filters should not be called"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_542bea81","line":1331,"range":{"start_line":1330,"start_character":31,"end_line":1331,"end_character":52},"updated":"2016-04-28 07:13:00.000000000","message":"I wonder, would it be better clearer to read by defining return value here?","commit_id":"01da3d72fa534d47810e3f43d4a93fdb5786e865"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cb86770f19cf8a787c7f3b53bb68fd3ba4d34326","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"    def test_get_instances_on_driver_empty(self, mock_instance_list):"},{"line_number":1330,"context_line":"        with mock.patch.object(self.compute.driver,"},{"line_number":1331,"context_line":"                               \u0027list_instance_uuids\u0027) as mock_driver_uuids:"},{"line_number":1332,"context_line":"            mock_driver_uuids.return_value \u003d []"},{"line_number":1333,"context_line":"            result \u003d self.compute._get_instances_on_driver(self.context)"},{"line_number":1334,"context_line":"            # Short circuit DB call, get_by_filters should not be called"},{"line_number":1335,"context_line":"            self.assertEqual(0, mock_instance_list.call_count)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_07ac789d","line":1332,"updated":"2016-04-29 14:55:01.000000000","message":"Please mock both of these using decorators to the test method. That way you reduce the amount of changed lines by at least one, since you\u0027re not indenting the entire test method content block.\n\nYou should be able to just do:\n\n @mock.patch(\u0027nova.virt.driver.list_instance_uuids\u0027,\n             return_value\u003d[])","commit_id":"01da3d72fa534d47810e3f43d4a93fdb5786e865"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"00a44f6074682fc76a7caeddf30834b7dda47c10","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"    def test_get_instances_on_driver_empty(self, mock_instance_list):"},{"line_number":1330,"context_line":"        with mock.patch.object(self.compute.driver,"},{"line_number":1331,"context_line":"                               \u0027list_instance_uuids\u0027) as mock_driver_uuids:"},{"line_number":1332,"context_line":"            mock_driver_uuids.return_value \u003d []"},{"line_number":1333,"context_line":"            result \u003d self.compute._get_instances_on_driver(self.context)"},{"line_number":1334,"context_line":"            # Short circuit DB call, get_by_filters should not be called"},{"line_number":1335,"context_line":"            self.assertEqual(0, mock_instance_list.call_count)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_70a6c0ab","line":1332,"in_reply_to":"1a122d0e_07ac789d","updated":"2016-04-29 16:00:08.000000000","message":"That doesn\u0027t exist though.\n\n    \u0027nova.virt.driver.list_instance_uuids\u0027\n\nOr did you mean this?\n\n    \u0027nova.virt.driver.ComputeDriver.list_instance_uuids\u0027\n\nIf so, that\u0027s not actually hit by this test... which was part of the original problem with this test.\n\nThis one is though:\n\n    \u0027nova.virt.fake.SmallFakeDriver.list_instance_uuids\u0027\n\nBut I still think it\u0027s better to mock the following, so you don\u0027t have to know that.\n\n    self.compute.driver.list_instance_uuids\n\nI\u0027ll respin and move the asserts out of the context manager though. I wanted to do that anyway to match this related patch: \n\nhttps://review.openstack.org/#/c/310631\n\nThanks for the review!","commit_id":"01da3d72fa534d47810e3f43d4a93fdb5786e865"}]}
