)]}'
{"nova/tests/functional/compute/test_live_migration.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"395a691aabfe1c62655baad9f2b31d584ca0001f","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class FakeCinderError(object):"},{"line_number":24,"context_line":"    \"\"\"Poor man\u0027s Mock because we\u0027re stubbing out and not mock.patching. Stubs"},{"line_number":25,"context_line":"    out attachment_delete. We keep a raise and call count to simulate a single"},{"line_number":26,"context_line":"    volume error while being able to assert that we still got called for all"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_f9a91bdd","line":23,"updated":"2019-10-01 15:33:56.000000000","message":"I think we can also replace this with your spy, no?","commit_id":"808f670ec862519d0d9e0933c2286c9493fc4116"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"dbd7c9ba9e57fc941ef4a6066060905740343e3d","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class FakeCinderError(object):"},{"line_number":24,"context_line":"    \"\"\"Poor man\u0027s Mock because we\u0027re stubbing out and not mock.patching. Stubs"},{"line_number":25,"context_line":"    out attachment_delete. We keep a raise and call count to simulate a single"},{"line_number":26,"context_line":"    volume error while being able to assert that we still got called for all"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_eb25c20b","line":23,"in_reply_to":"3fa7e38b_7931aba2","updated":"2019-10-01 16:52:28.000000000","message":"Ah, you\u0027re right about the original behaviour bit. I see your point about making it a mock, though I\u0027d have to look for the exact way of raising on only the *first* call - side_effect\u003d\u003citerable\u003e or whatever.","commit_id":"808f670ec862519d0d9e0933c2286c9493fc4116"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"779507fdee7fd8d3863b08a4dcc5f877b56f126b","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class FakeCinderError(object):"},{"line_number":24,"context_line":"    \"\"\"Poor man\u0027s Mock because we\u0027re stubbing out and not mock.patching. Stubs"},{"line_number":25,"context_line":"    out attachment_delete. We keep a raise and call count to simulate a single"},{"line_number":26,"context_line":"    volume error while being able to assert that we still got called for all"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_3c3a3734","line":23,"in_reply_to":"3fa7e38b_eb25c20b","updated":"2019-10-02 10:48:19.000000000","message":"So what you need here is\n* raise on the first call\n* do nothing on any subsequent calls (instead of call the original)\n\nIf you know that the number of subsequent calls is N then this can be done with something like\n\n  with mock.patch(\u0027target.func\u0027, side_effect\u003d[CinderConnectionFailed()] + [mock.Mock()] * N):\n      \u003cdo your stuff\u003e\n\nIn the other hand if you don\u0027t know the value of N then you need a potentially infinite iterable as side_effect:\n\n  with mock.patch(\u0027target.func\u0027, side_effect\u003ditertools.chain([CinderConnectionFailed()], iter(mock.Mock, None))):\n      \u003cdo your stuff\u003e","commit_id":"808f670ec862519d0d9e0933c2286c9493fc4116"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9c2110b8da24b7269bcbf0c350b2d90711aded11","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova.tests.unit import fake_notifier"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class FakeCinderError(object):"},{"line_number":24,"context_line":"    \"\"\"Poor man\u0027s Mock because we\u0027re stubbing out and not mock.patching. Stubs"},{"line_number":25,"context_line":"    out attachment_delete. We keep a raise and call count to simulate a single"},{"line_number":26,"context_line":"    volume error while being able to assert that we still got called for all"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_7931aba2","line":23,"in_reply_to":"3fa7e38b_f9a91bdd","updated":"2019-10-01 16:35:14.000000000","message":"This never needs to call the original behavior so I think this can be converted to a mock. The caller needs to change from stub_out() to mock.patch() though.","commit_id":"808f670ec862519d0d9e0933c2286c9493fc4116"}],"nova/tests/functional/regressions/test_bug_1843090.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f891a2a20e341135429e720ff062685271f34d3f","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        def spy_resize_claim("},{"line_number":84,"context_line":"                spy, _self, context, instance, instance_type, nodename, *args,"},{"line_number":85,"context_line":"                **kwargs):"},{"line_number":86,"context_line":"            spy.claim_calls_on_node \u003d getattr(spy, \u0027claim_calls_on_node\u0027, [])"},{"line_number":87,"context_line":"            spy.claim_calls_on_node.append(nodename)"},{"line_number":88,"context_line":"            if len(spy.claim_calls_on_node) \u003d\u003d 1:"},{"line_number":89,"context_line":"                raise exception.ComputeResourcesUnavailable("}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_05759ecc","line":86,"range":{"start_line":86,"start_character":12,"end_line":86,"end_character":77},"updated":"2019-10-02 13:51:40.000000000","message":"This is awkward, would be nice to figure out a way we didn\u0027t have to do it.\n\nOne way would be to allow the caller to create the data container, see https://review.opendev.org/#/c/685949/3/nova/tests/spy.py@22","commit_id":"e7544944f801c749a887e8226da0dab79130755c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dc4647ca84d1d4918b534110b6cbb3fa5e6ac0d3","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        def spy_resize_claim("},{"line_number":84,"context_line":"                spy, _self, context, instance, instance_type, nodename, *args,"},{"line_number":85,"context_line":"                **kwargs):"},{"line_number":86,"context_line":"            spy.claim_calls_on_node \u003d getattr(spy, \u0027claim_calls_on_node\u0027, [])"},{"line_number":87,"context_line":"            spy.claim_calls_on_node.append(nodename)"},{"line_number":88,"context_line":"            if len(spy.claim_calls_on_node) \u003d\u003d 1:"},{"line_number":89,"context_line":"                raise exception.ComputeResourcesUnavailable("}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_4bf16701","line":86,"range":{"start_line":86,"start_character":12,"end_line":86,"end_character":77},"in_reply_to":"3fa7e38b_05759ecc","updated":"2019-10-02 14:52:31.000000000","message":"I agree this is ugly.","commit_id":"e7544944f801c749a887e8226da0dab79130755c"}]}
