)]}'
{"nova/tests/unit/virt/test_block_device.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":549,"context_line":"            fake_volume[\u0027shared_targets\u0027] \u003d True"},{"line_number":550,"context_line":"            fake_volume[\u0027service_uuid\u0027] \u003d uuids.service_uuid"},{"line_number":551,"context_line":"            self.volume_api.get("},{"line_number":552,"context_line":"                self.context, fake_volume[\u0027id\u0027],"},{"line_number":553,"context_line":"                microversion\u003d\u00273.48\u0027).AndReturn(fake_volume)"},{"line_number":554,"context_line":"        else:"},{"line_number":555,"context_line":"            # First call to get() fails because the API isn\u0027t new enough."},{"line_number":556,"context_line":"            self.volume_api.get("}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_93901645","side":"PARENT","line":553,"range":{"start_line":552,"start_character":16,"end_line":553,"end_character":35},"updated":"2019-07-01 20:25:46.000000000","message":"PS46 L635-6","commit_id":"d540903463aa9b0cf69cefac7cc60e5b70e40a1c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        else:"},{"line_number":555,"context_line":"            # First call to get() fails because the API isn\u0027t new enough."},{"line_number":556,"context_line":"            self.volume_api.get("},{"line_number":557,"context_line":"                self.context, fake_volume[\u0027id\u0027], microversion\u003d\u00273.48\u0027).AndRaise("},{"line_number":558,"context_line":"                    exception.CinderAPIVersionNotAvailable(version\u003d\u00273.48\u0027))"},{"line_number":559,"context_line":"            # So we fallback to the old call."},{"line_number":560,"context_line":"            self.volume_api.get(self.context,"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_7399e26a","side":"PARENT","line":557,"range":{"start_line":557,"start_character":16,"end_line":557,"end_character":68},"updated":"2019-07-01 20:25:46.000000000","message":"PS46 L641-2","commit_id":"d540903463aa9b0cf69cefac7cc60e5b70e40a1c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":557,"context_line":"                self.context, fake_volume[\u0027id\u0027], microversion\u003d\u00273.48\u0027).AndRaise("},{"line_number":558,"context_line":"                    exception.CinderAPIVersionNotAvailable(version\u003d\u00273.48\u0027))"},{"line_number":559,"context_line":"            # So we fallback to the old call."},{"line_number":560,"context_line":"            self.volume_api.get(self.context,"},{"line_number":561,"context_line":"                                fake_volume[\u0027id\u0027]).AndReturn(fake_volume)"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        if not fail_check_av_zone:"},{"line_number":564,"context_line":"            self.volume_api.check_availability_zone(self.context,"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_53affe7b","side":"PARENT","line":561,"range":{"start_line":560,"start_character":32,"end_line":561,"end_character":49},"updated":"2019-07-01 20:25:46.000000000","message":"PS46 L643","commit_id":"d540903463aa9b0cf69cefac7cc60e5b70e40a1c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":671,"context_line":"        test_bdm.attach(self.context, instance,"},{"line_number":672,"context_line":"                        self.volume_api, self.virt_driver)"},{"line_number":673,"context_line":"        self.assertThat(test_bdm[\u0027connection_info\u0027],"},{"line_number":674,"context_line":"                        matchers.DictMatches(expected_conn_info))"},{"line_number":675,"context_line":""},{"line_number":676,"context_line":"    def test_volume_attach_with_shared_targets(self):"},{"line_number":677,"context_line":"        self.test_volume_attach(include_shared_targets\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_d69bdc6f","side":"PARENT","line":674,"updated":"2019-07-01 20:25:46.000000000","message":"I might have been inclined to leave these assertions here rather than trying to collect them in the Helper of a Thousand Branches...","commit_id":"d540903463aa9b0cf69cefac7cc60e5b70e40a1c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        expected_save_calls \u003d []"},{"line_number":532,"context_line":"        if driver_multi_attach:"},{"line_number":533,"context_line":"            # \u0027supports_multiattach\u0027 is True"},{"line_number":534,"context_line":"            self.virt_driver.capabilities.get.return_value \u003d True"},{"line_number":535,"context_line":"        else:"},{"line_number":536,"context_line":"            # \u0027supports_multiattach\u0027 is False"},{"line_number":537,"context_line":"            self.virt_driver.capabilities.get.return_value \u003d False"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_70b6b8fb","line":534,"range":{"start_line":534,"start_character":41,"end_line":534,"end_character":58},"updated":"2019-07-01 20:25:46.000000000","message":"This is a lot less explicit than it was. Is it because of autospec that you can\u0027t do it the way it was before?\n\n[Later] It\u0027s because self.virt_driver.capabilities is a magic mock with an automatic no-op __setitem__:\n\n In [2]: m \u003d mock.MagicMock()\n \n In [3]: m[\u0027foo\u0027] \u003d \u0027bar\u0027\n \n In [4]: m[\u0027foo\u0027]\n Out[4]: \u003cMagicMock name\u003d\u0027mock.__getitem__()\u0027 id\u003d\u0027140003881448080\u0027\u003e\n\nSo the way to make this work is to make .capabilities an actual dict, like\n\n self.virt_driver.capabilities \u003d {\u0027supports_multi_attach\u0027: True}\n\nEven better (though unrelated) would be to collapse L532-7 to:\n\n self.virt_driver.capabilities \u003d {\n     \u0027supports_multiattach\u0027: driver_multi_attach}","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2a1a23820e668335d34e55bb36819cc977c1c58a","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        expected_save_calls \u003d []"},{"line_number":532,"context_line":"        if driver_multi_attach:"},{"line_number":533,"context_line":"            # \u0027supports_multiattach\u0027 is True"},{"line_number":534,"context_line":"            self.virt_driver.capabilities.get.return_value \u003d True"},{"line_number":535,"context_line":"        else:"},{"line_number":536,"context_line":"            # \u0027supports_multiattach\u0027 is False"},{"line_number":537,"context_line":"            self.virt_driver.capabilities.get.return_value \u003d False"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_a1670425","line":534,"range":{"start_line":534,"start_character":41,"end_line":534,"end_character":58},"in_reply_to":"9fb8cfa7_70b6b8fb","updated":"2019-07-01 21:59:40.000000000","message":"Could you use patch.dict?\n\nhttps://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch.dict","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"fb59abb351f4cc8e1ae9734f29d90a5d295be72f","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        expected_save_calls \u003d []"},{"line_number":532,"context_line":"        if driver_multi_attach:"},{"line_number":533,"context_line":"            # \u0027supports_multiattach\u0027 is True"},{"line_number":534,"context_line":"            self.virt_driver.capabilities.get.return_value \u003d True"},{"line_number":535,"context_line":"        else:"},{"line_number":536,"context_line":"            # \u0027supports_multiattach\u0027 is False"},{"line_number":537,"context_line":"            self.virt_driver.capabilities.get.return_value \u003d False"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_bc8e4776","line":534,"range":{"start_line":534,"start_character":41,"end_line":534,"end_character":58},"in_reply_to":"9fb8cfa7_a1670425","updated":"2019-07-01 22:20:20.000000000","message":"If it were a dict, you could, but it\u0027s not, because it\u0027s being autogenerated by accessing the .capabilities of the parent (self.virt_driver) which is a mock.","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        if include_shared_targets:"},{"line_number":554,"context_line":"            fake_volume[\u0027shared_targets\u0027] \u003d True"},{"line_number":555,"context_line":"            fake_volume[\u0027service_uuid\u0027] \u003d uuids.service_uuid"},{"line_number":556,"context_line":"            self.volume_api.get.return_value \u003d fake_volume"},{"line_number":557,"context_line":"        else:"},{"line_number":558,"context_line":"            # First call to get() fails because the API isn\u0027t new enough."},{"line_number":559,"context_line":"            # So we fallback to the old call."}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_7641d009","line":556,"updated":"2019-07-01 20:25:46.000000000","message":"This might be more readable (test flow-wise - but also as a delta from the mox\u0027d version) if you saved an exp_volapi_get_calls here to assert later.","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":567,"context_line":"                    test.TestingException())"},{"line_number":568,"context_line":"                # The @update_db decorator will save any changes."},{"line_number":569,"context_line":"                expected_save_calls.append(mock.call())"},{"line_number":570,"context_line":"                # Exit setting mock"},{"line_number":571,"context_line":"                raise test.TestingException()"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"            self.virt_driver.get_volume_connector.return_value \u003d connector"},{"line_number":574,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_f3eb92a0","line":571,"range":{"start_line":570,"start_character":16,"end_line":571,"end_character":45},"updated":"2019-07-01 20:25:46.000000000","message":"Ugh, these are gross. Prefer wrapping L565-609 in an inner method and replacing these with `return`.\n\n[Later] With some minor refactoring, you don\u0027t even need to do that.","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":646,"context_line":"            self.volume_api.check_availability_zone.assert_called_once_with("},{"line_number":647,"context_line":"                self.context, fake_volume, instance\u003dinstance)"},{"line_number":648,"context_line":"            if fail_check_av_zone:"},{"line_number":649,"context_line":"                # Exit assert calls"},{"line_number":650,"context_line":"                raise test.TestingException()"},{"line_number":651,"context_line":""},{"line_number":652,"context_line":"            self.virt_driver.get_volume_connector.assert_called_once_with("},{"line_number":653,"context_line":"                instance)"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_735c827c","line":650,"range":{"start_line":649,"start_character":16,"end_line":650,"end_character":45},"updated":"2019-07-01 20:25:46.000000000","message":"same comment as above\n\nIn this case, if you move the mock_save assertion up, you can get rid of the try/except and replace these with returns.","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":685,"context_line":""},{"line_number":686,"context_line":"            if volume_attach:"},{"line_number":687,"context_line":"                if not fail_volume_attach:"},{"line_number":688,"context_line":"                    if self.attachment_id is None:"},{"line_number":689,"context_line":"                        self.volume_api.attach.assert_called_once_with("},{"line_number":690,"context_line":"                            elevated_context, fake_volume[\u0027id\u0027], uuids.uuid,"},{"line_number":691,"context_line":"                            bdm_dict[\u0027device_name\u0027], mode\u003daccess_mode)"},{"line_number":692,"context_line":"                    else:"},{"line_number":693,"context_line":"                        mock_att_complete \u003d self.volume_api.attachment_complete"},{"line_number":694,"context_line":"                        mock_att_complete.assert_called_once_with("},{"line_number":695,"context_line":"                            elevated_context, self.attachment_id)"},{"line_number":696,"context_line":"                else:"},{"line_number":697,"context_line":"                    if self.attachment_id is None:"},{"line_number":698,"context_line":"                        self.volume_api.attach.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_d6ed1cf0","line":695,"range":{"start_line":688,"start_character":0,"end_line":695,"end_character":65},"updated":"2019-07-01 20:25:46.000000000","message":"this could be DRYed out in a spirit similar to the `if driver_attach` block above.","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        except test.TestingException:"},{"line_number":714,"context_line":"            pass"},{"line_number":715,"context_line":""},{"line_number":716,"context_line":"        if expected_save_calls:"},{"line_number":717,"context_line":"            mock_save.assert_has_calls(expected_save_calls)"},{"line_number":718,"context_line":""},{"line_number":719,"context_line":"    def test_volume_attach(self, include_shared_targets\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_b3351af9","line":716,"range":{"start_line":716,"start_character":11,"end_line":716,"end_character":30},"updated":"2019-07-01 20:25:46.000000000","message":"this is never empty","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":714,"context_line":"            pass"},{"line_number":715,"context_line":""},{"line_number":716,"context_line":"        if expected_save_calls:"},{"line_number":717,"context_line":"            mock_save.assert_has_calls(expected_save_calls)"},{"line_number":718,"context_line":""},{"line_number":719,"context_line":"    def test_volume_attach(self, include_shared_targets\u003dFalse):"},{"line_number":720,"context_line":"        test_bdm \u003d self.driver_classes[\u0027volume\u0027]("}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_b6518810","line":717,"range":{"start_line":717,"start_character":22,"end_line":717,"end_character":38},"updated":"2019-07-01 20:25:46.000000000","message":"This doesn\u0027t assert the *number* of calls, which is sometimes one and sometimes two.","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":996,"context_line":"            self.assertEqual(\u0027fake-volume-id-2\u0027, test_bdm.volume_id)"},{"line_number":997,"context_line":"            mock_attach.assert_called_once_with("},{"line_number":998,"context_line":"                self.context, instance, self.volume_api, self.virt_driver)"},{"line_number":999,"context_line":"            # Make sure theses are not called"},{"line_number":1000,"context_line":"            mock_get_snapshot.assert_not_called()"},{"line_number":1001,"context_line":"            mock_create.assert_not_called()"},{"line_number":1002,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_56a84c8a","line":999,"range":{"start_line":999,"start_character":12,"end_line":999,"end_character":45},"updated":"2019-07-01 20:25:46.000000000","message":"This comment is pretty redundant now\n\nAlso \u0027theses\u0027 (carried over)","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e6cf31beefaf4c1adbb1e620a80881cf18b6ddeb","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"            self.assertEqual(\u0027fake-volume-id-2\u0027, test_bdm.volume_id)"},{"line_number":1105,"context_line":"            mock_attch.assert_called_once_with("},{"line_number":1106,"context_line":"                self.context, instance, self.volume_api, self.virt_driver)"},{"line_number":1107,"context_line":"            # Make sure theses are not called"},{"line_number":1108,"context_line":"            mock_get_snapshot.assert_not_called()"},{"line_number":1109,"context_line":"            mock_create.assert_not_called()"},{"line_number":1110,"context_line":""}],"source_content_type":"text/x-python","patch_set":46,"id":"9fb8cfa7_76ab1087","line":1107,"range":{"start_line":1107,"start_character":11,"end_line":1107,"end_character":45},"updated":"2019-07-01 20:25:46.000000000","message":"ditto","commit_id":"1eb7b17a181902e83f6051881231411f931eae25"}]}
