)]}'
{"neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py":[{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"a2efd705b91e5ab674e65ed49d3b2d94e3051508","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        super(TestLinuxBridgeAgent, self).setUp()"},{"line_number":98,"context_line":"        cfg.CONF.set_override(\u0027rpc_backend\u0027,"},{"line_number":99,"context_line":"                              \u0027neutron.openstack.common.rpc.impl_fake\u0027)"},{"line_number":100,"context_line":"        mock_specific \u003d mock.MagicMock(return_value\u003d"},{"line_number":101,"context_line":"                                       mock.MagicMock(local_ip\u003dLOCAL_IP))"},{"line_number":102,"context_line":"        self.lbmgr_patcher \u003d mock.patch(\u0027neutron.plugins.linuxbridge.agent.\u0027"},{"line_number":103,"context_line":"                                        \u0027linuxbridge_neutron_agent.\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAS3%2F%2FHFE%3D","line":100,"updated":"2013-10-04 07:28:52.000000000","message":"if you don\u0027t want to mock FixedIntervalLoopingCall, and insist this patch, i would suggest you change mock_specific to \n\n    mock_specific \u003d mock.MagicMock(local_ip\u003dLOCAL_IP)\n\nsince i cannot reproduce this bug, i just right a demo code for the mock\n\n    import mock\n\n    class A(object):\n        pass\n\n    mm \u003d mock.MagicMock(id\u003d\u0027123\u0027)\n    with mock.patch(\u0027__main__.A\u0027, return_value\u003dmm):\n        a \u003d A()\n        # print: 123\n        print a.id\n\n    mm \u003d mock.MagicMock(return_value\u003dmock.MagicMock(id\u003d\u0027123\u0027))\n    with mock.patch(\u0027__main__.A\u0027, return_value\u003dmm):\n        a \u003d A()\n        # print: \u003cMagicMock name\u003d\u0027mock.id\u0027 id\u003d\u00273071002540\u0027\u003e\n        print a.id","commit_id":"e801acc2054c476791b261003d9d74d84feb7d2c"},{"author":{"_account_id":6522,"name":"Sean McCully","email":"sean_mccully@yahoo.com","username":"sean-mccully"},"change_message_id":"1bfcb8b00b6e812e2702fb15abdf8f79dc7af88e","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        super(TestLinuxBridgeAgent, self).setUp()"},{"line_number":98,"context_line":"        cfg.CONF.set_override(\u0027rpc_backend\u0027,"},{"line_number":99,"context_line":"                              \u0027neutron.openstack.common.rpc.impl_fake\u0027)"},{"line_number":100,"context_line":"        mock_specific \u003d mock.MagicMock(return_value\u003d"},{"line_number":101,"context_line":"                                       mock.MagicMock(local_ip\u003dLOCAL_IP))"},{"line_number":102,"context_line":"        self.lbmgr_patcher \u003d mock.patch(\u0027neutron.plugins.linuxbridge.agent.\u0027"},{"line_number":103,"context_line":"                                        \u0027linuxbridge_neutron_agent.\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2Fxyc%3D","line":100,"in_reply_to":"AAAAS3%2F%2FHFE%3D","updated":"2013-10-09 23:15:44.000000000","message":"Right with a context manager, and now as implemented as the code is written without the use of the context manager, code works as expected.\n\nclass A(object):\n   ...:     ip_local \u003d \u0027123\u0027\n   ...:\nmocker \u003d mock.patch(\u0027__main__.A\u0027, return_value\u003dmock.MagicMock(id\u003d\u0027321\u0027))\nmocker.start()\n: A().id\nOut[12]: \u0027321\u0027\n\n: mocker \u003d mock.patch(\u0027__main__.A\u0027, id\u003d\u0027321\u0027)\n mocker.start()\n A().id\nOut[16]: \u003cMagicMock name\u003d\u0027A().id\u0027 id\u003d\u002733621456\u0027\u003e","commit_id":"e801acc2054c476791b261003d9d74d84feb7d2c"}]}
