)]}'
{"nova/tests/unit/test_cinder.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"864f26af9a800e860573c1f67ecae5952ecadb14","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            return_value\u003d\u0027http://localhost:8776/v1/%(project_id)s\u0027)"},{"line_number":129,"context_line":"        fake_session \u003d mock.Mock(get_endpoint\u003dget_endpoint)"},{"line_number":130,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":131,"context_line":"        with mock.patch.object(cinder, \u0027_SESSION\u0027, fake_session):"},{"line_number":132,"context_line":"            self.assertRaises(exception.UnsupportedCinderAPIVersion,"},{"line_number":133,"context_line":"                              cinder.cinderclient, ctxt)"},{"line_number":134,"context_line":"        get_api_version.assert_called_once_with(get_endpoint.return_value)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5201f7_aae0192a","line":131,"updated":"2017-01-06 15:24:25.000000000","message":"I think this helps, because someone else has already set _SESSION, thus meaning the previous mock never executes here. Re-writing _SESSION directly is quite different, as that now means it doesn\u0027t matter if _SESSION has already been set to something other than None.\n\nWell its a direct mock of this call:\nhttps://github.com/openstack/nova/blob/master/nova/volume/cinder.py#L80\nand this call:\nhttps://github.com/openstack/nova/blob/master/nova/volume/cinder.py#L61","commit_id":"5593049ace9617c1bd15e4a0f4d57208c3c66228"}]}
