)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"77077a9f091fbcdfe69e02b6f52a19850668a1f9","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Bo Chi \u003cbochi@tethrnet.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-12-28 21:35:36 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"fix _check_driver_to_bind"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"_check_driver_to_bind function tries to compare driver with"},{"line_number":10,"context_line":"with driver name, this change fix it"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f91af0f_8e0f5a2d","line":7,"range":{"start_line":7,"start_character":4,"end_line":7,"end_character":25},"updated":"2018-01-02 18:32:34.000000000","message":"This patch actually proposes to fix _bind_port_level not _check_driver_to_bind","commit_id":"0ad782536d6a2da61b72874b3fad04528018444f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"9c3381da5414024f3324adcf3328b5e5c4b59010","unresolved":false,"context_lines":[{"line_number":7,"context_line":"fix _check_driver_to_bind"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"_check_driver_to_bind function tries to compare driver with"},{"line_number":10,"context_line":"with driver name, this change fix it"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I62b32c9b9d01dd929fe8cd3634c78dc0cbe325b6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f91af0f_45738ce8","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":4},"updated":"2017-12-29 18:03:24.000000000","message":"double \"with\"","commit_id":"0ad782536d6a2da61b72874b3fad04528018444f"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"77077a9f091fbcdfe69e02b6f52a19850668a1f9","unresolved":false,"context_lines":[{"line_number":7,"context_line":"fix _check_driver_to_bind"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"_check_driver_to_bind function tries to compare driver with"},{"line_number":10,"context_line":"with driver name, this change fix it"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I62b32c9b9d01dd929fe8cd3634c78dc0cbe325b6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f91af0f_73b19f8f","line":10,"range":{"start_line":10,"start_character":30,"end_line":10,"end_character":33},"updated":"2018-01-02 18:32:34.000000000","message":"fixes","commit_id":"0ad782536d6a2da61b72874b3fad04528018444f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4b30e987ed00d98ddcb78e7bd20f8ef84ac71888","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"when a mechinism driver calls context.continue_binding to"},{"line_number":10,"context_line":"continue binding, it will be called again because parameter"},{"line_number":11,"context_line":"passed to _check_driver_to_bind is not correct."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-Bug: #1745572"},{"line_number":14,"context_line":"Change-Id: I62b32c9b9d01dd929fe8cd3634c78dc0cbe325b6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f93b717_c73749e3","line":11,"updated":"2018-01-29 10:55:28.000000000","message":"now this description is out of date","commit_id":"b07b8611e8046aefbb4fad579e5372cf1f074553"}],"neutron/plugins/ml2/managers.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"971249de461bb5dae3c1346baca397b2fa2ea87c","unresolved":false,"context_lines":[{"line_number":845,"context_line":"                break"},{"line_number":846,"context_line":"        return hosts_with_access"},{"line_number":847,"context_line":""},{"line_number":848,"context_line":"    def _check_driver_to_bind(self, driver, segments_to_bind, binding_levels):"},{"line_number":849,"context_line":"        # To prevent a possible binding loop, don\u0027t try to bind with"},{"line_number":850,"context_line":"        # this driver if the same driver has already bound at a higher"},{"line_number":851,"context_line":"        # level to one of the segments we are currently trying to"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_968e59ce","line":848,"range":{"start_line":848,"start_character":36,"end_line":848,"end_character":42},"updated":"2018-01-29 09:07:21.000000000","message":"if You want to change this argument, maybe it\u0027s worth to change this parameter to \"driver_name\" also?","commit_id":"a39827e309902ed40678b24e4f4087f446c30522"},{"author":{"_account_id":18785,"name":"Bo Chi","email":"bochi@tethrnet.com","username":"bochi"},"change_message_id":"d44bab61c6d7d319403a76ae509f4673f55d615a","unresolved":false,"context_lines":[{"line_number":845,"context_line":"                break"},{"line_number":846,"context_line":"        return hosts_with_access"},{"line_number":847,"context_line":""},{"line_number":848,"context_line":"    def _check_driver_to_bind(self, driver, segments_to_bind, binding_levels):"},{"line_number":849,"context_line":"        # To prevent a possible binding loop, don\u0027t try to bind with"},{"line_number":850,"context_line":"        # this driver if the same driver has already bound at a higher"},{"line_number":851,"context_line":"        # level to one of the segments we are currently trying to"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_1139f33f","line":848,"range":{"start_line":848,"start_character":36,"end_line":848,"end_character":42},"in_reply_to":"5f93b717_968e59ce","updated":"2018-01-29 09:36:43.000000000","message":"Done","commit_id":"a39827e309902ed40678b24e4f4087f446c30522"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"971249de461bb5dae3c1346baca397b2fa2ea87c","unresolved":false,"context_lines":[{"line_number":854,"context_line":"        segment_ids_to_bind \u003d {s[api.SEGMENTATION_ID]"},{"line_number":855,"context_line":"                               for s in segments_to_bind}"},{"line_number":856,"context_line":"        for level in binding_levels:"},{"line_number":857,"context_line":"            if (level.driver \u003d\u003d driver and"},{"line_number":858,"context_line":"                    level.segment_id in segment_ids_to_bind):"},{"line_number":859,"context_line":"                LOG.debug(\"segment %(segment) is already binded \""},{"line_number":860,"context_line":"                          \"by driver %(driver)\","}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_d6ff0132","line":857,"updated":"2018-01-29 09:07:21.000000000","message":"why can\u0027t You change here to something like:\n    if level.driver \u003d\u003d driver.name\n\ninstead of changing what is passed to this method?","commit_id":"a39827e309902ed40678b24e4f4087f446c30522"},{"author":{"_account_id":18785,"name":"Bo Chi","email":"bochi@tethrnet.com","username":"bochi"},"change_message_id":"d44bab61c6d7d319403a76ae509f4673f55d615a","unresolved":false,"context_lines":[{"line_number":854,"context_line":"        segment_ids_to_bind \u003d {s[api.SEGMENTATION_ID]"},{"line_number":855,"context_line":"                               for s in segments_to_bind}"},{"line_number":856,"context_line":"        for level in binding_levels:"},{"line_number":857,"context_line":"            if (level.driver \u003d\u003d driver and"},{"line_number":858,"context_line":"                    level.segment_id in segment_ids_to_bind):"},{"line_number":859,"context_line":"                LOG.debug(\"segment %(segment) is already binded \""},{"line_number":860,"context_line":"                          \"by driver %(driver)\","}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_b13fdf23","line":857,"in_reply_to":"5f93b717_d6ff0132","updated":"2018-01-29 09:36:43.000000000","message":"Done","commit_id":"a39827e309902ed40678b24e4f4087f446c30522"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4b30e987ed00d98ddcb78e7bd20f8ef84ac71888","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        for level in binding_levels:"},{"line_number":857,"context_line":"            if (level.driver \u003d\u003d driver.name and"},{"line_number":858,"context_line":"                    level.segment_id in segment_ids_to_bind):"},{"line_number":859,"context_line":"                LOG.debug(\"segment %(segment) is already binded \""},{"line_number":860,"context_line":"                          \"by driver %(driver)\","},{"line_number":861,"context_line":"                          {\"semgnet\": level.segment_id,"},{"line_number":862,"context_line":"                           \"driver\": level.driver})"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f93b717_873141ef","line":859,"range":{"start_line":859,"start_character":57,"end_line":859,"end_character":63},"updated":"2018-01-29 10:55:28.000000000","message":"s/binded/bound","commit_id":"b07b8611e8046aefbb4fad579e5372cf1f074553"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4b30e987ed00d98ddcb78e7bd20f8ef84ac71888","unresolved":false,"context_lines":[{"line_number":858,"context_line":"                    level.segment_id in segment_ids_to_bind):"},{"line_number":859,"context_line":"                LOG.debug(\"segment %(segment) is already binded \""},{"line_number":860,"context_line":"                          \"by driver %(driver)\","},{"line_number":861,"context_line":"                          {\"semgnet\": level.segment_id,"},{"line_number":862,"context_line":"                           \"driver\": level.driver})"},{"line_number":863,"context_line":"                return False"},{"line_number":864,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f93b717_274e2d6f","line":861,"range":{"start_line":861,"start_character":28,"end_line":861,"end_character":35},"updated":"2018-01-29 10:55:28.000000000","message":"s/semgnet/segment","commit_id":"b07b8611e8046aefbb4fad579e5372cf1f074553"},{"author":{"_account_id":21781,"name":"Hunt Xu","email":"mhuntxu@gmail.com","username":"huntxu"},"change_message_id":"838cdf3d57c60bb12840e0af8f155c3b263ef7e8","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        for level in binding_levels:"},{"line_number":857,"context_line":"            if (level.driver \u003d\u003d driver.name and"},{"line_number":858,"context_line":"                    level.segment_id in segment_ids_to_bind):"},{"line_number":859,"context_line":"                LOG.debug(\"segment %(segment) is already bound \""},{"line_number":860,"context_line":"                          \"by driver %(driver)\","},{"line_number":861,"context_line":"                          {\"segment\": level.segment_id,"},{"line_number":862,"context_line":"                           \"driver\": level.driver})"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_3d436615","line":859,"range":{"start_line":859,"start_character":35,"end_line":859,"end_character":45},"updated":"2018-01-31 08:55:23.000000000","message":"%(segment)s","commit_id":"34202881a2206fc355008c5b6c7b769cbd34d010"},{"author":{"_account_id":18785,"name":"Bo Chi","email":"bochi@tethrnet.com","username":"bochi"},"change_message_id":"f6a55792adaea0b8e9c2eeff1c29271d6ba4b0c2","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        for level in binding_levels:"},{"line_number":857,"context_line":"            if (level.driver \u003d\u003d driver.name and"},{"line_number":858,"context_line":"                    level.segment_id in segment_ids_to_bind):"},{"line_number":859,"context_line":"                LOG.debug(\"segment %(segment) is already bound \""},{"line_number":860,"context_line":"                          \"by driver %(driver)\","},{"line_number":861,"context_line":"                          {\"segment\": level.segment_id,"},{"line_number":862,"context_line":"                           \"driver\": level.driver})"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_f06a0518","line":859,"range":{"start_line":859,"start_character":35,"end_line":859,"end_character":45},"in_reply_to":"5f93b717_3d436615","updated":"2018-01-31 09:44:56.000000000","message":"Done","commit_id":"34202881a2206fc355008c5b6c7b769cbd34d010"},{"author":{"_account_id":21781,"name":"Hunt Xu","email":"mhuntxu@gmail.com","username":"huntxu"},"change_message_id":"838cdf3d57c60bb12840e0af8f155c3b263ef7e8","unresolved":false,"context_lines":[{"line_number":857,"context_line":"            if (level.driver \u003d\u003d driver.name and"},{"line_number":858,"context_line":"                    level.segment_id in segment_ids_to_bind):"},{"line_number":859,"context_line":"                LOG.debug(\"segment %(segment) is already bound \""},{"line_number":860,"context_line":"                          \"by driver %(driver)\","},{"line_number":861,"context_line":"                          {\"segment\": level.segment_id,"},{"line_number":862,"context_line":"                           \"driver\": level.driver})"},{"line_number":863,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_bd4e9635","line":860,"range":{"start_line":860,"start_character":37,"end_line":860,"end_character":46},"updated":"2018-01-31 08:55:23.000000000","message":"%(driver)s","commit_id":"34202881a2206fc355008c5b6c7b769cbd34d010"},{"author":{"_account_id":18785,"name":"Bo Chi","email":"bochi@tethrnet.com","username":"bochi"},"change_message_id":"f6a55792adaea0b8e9c2eeff1c29271d6ba4b0c2","unresolved":false,"context_lines":[{"line_number":857,"context_line":"            if (level.driver \u003d\u003d driver.name and"},{"line_number":858,"context_line":"                    level.segment_id in segment_ids_to_bind):"},{"line_number":859,"context_line":"                LOG.debug(\"segment %(segment) is already bound \""},{"line_number":860,"context_line":"                          \"by driver %(driver)\","},{"line_number":861,"context_line":"                          {\"segment\": level.segment_id,"},{"line_number":862,"context_line":"                           \"driver\": level.driver})"},{"line_number":863,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_90738116","line":860,"range":{"start_line":860,"start_character":37,"end_line":860,"end_character":46},"in_reply_to":"5f93b717_bd4e9635","updated":"2018-01-31 09:44:56.000000000","message":"Done","commit_id":"34202881a2206fc355008c5b6c7b769cbd34d010"}],"neutron/tests/unit/plugins/ml2/_test_mech_agent.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"971249de461bb5dae3c1346baca397b2fa2ea87c","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from neutron_lib.api.definitions import portbindings"},{"line_number":17,"context_line":"from neutron_lib.plugins.ml2 import api"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_b6b27593","side":"PARENT","line":15,"updated":"2018-01-29 09:07:21.000000000","message":"unrelated change","commit_id":"639b83264c1f87a558004c174ae41714509ddbce"},{"author":{"_account_id":18785,"name":"Bo Chi","email":"bochi@tethrnet.com","username":"bochi"},"change_message_id":"d44bab61c6d7d319403a76ae509f4673f55d615a","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from neutron_lib.api.definitions import portbindings"},{"line_number":17,"context_line":"from neutron_lib.plugins.ml2 import api"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_f1356747","side":"PARENT","line":15,"in_reply_to":"5f93b717_b6b27593","updated":"2018-01-29 09:36:43.000000000","message":"Done","commit_id":"639b83264c1f87a558004c174ae41714509ddbce"}],"neutron/tests/unit/plugins/ml2/test_managers.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"971249de461bb5dae3c1346baca397b2fa2ea87c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        context \u003d FakePortContext(None,"},{"line_number":41,"context_line":"                                  None,"},{"line_number":42,"context_line":"                                  segments_to_bind)"},{"line_number":43,"context_line":"        context._binding \u003d mock.Mock(vrf_type\u003dNone,"},{"line_number":44,"context_line":"                                     vrf_details\u003dNone)"},{"line_number":45,"context_line":"        context._binding_levels \u003d []"},{"line_number":46,"context_line":"        context._new_bound_segment \u003d segment_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_364d059a","line":43,"range":{"start_line":43,"start_character":37,"end_line":43,"end_character":40},"updated":"2018-01-29 09:07:21.000000000","message":"shouldn\u0027t be \"vif_type\"?","commit_id":"a39827e309902ed40678b24e4f4087f446c30522"},{"author":{"_account_id":18785,"name":"Bo Chi","email":"bochi@tethrnet.com","username":"bochi"},"change_message_id":"d44bab61c6d7d319403a76ae509f4673f55d615a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        context \u003d FakePortContext(None,"},{"line_number":41,"context_line":"                                  None,"},{"line_number":42,"context_line":"                                  segments_to_bind)"},{"line_number":43,"context_line":"        context._binding \u003d mock.Mock(vrf_type\u003dNone,"},{"line_number":44,"context_line":"                                     vrf_details\u003dNone)"},{"line_number":45,"context_line":"        context._binding_levels \u003d []"},{"line_number":46,"context_line":"        context._new_bound_segment \u003d segment_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_31074f85","line":43,"range":{"start_line":43,"start_character":37,"end_line":43,"end_character":40},"in_reply_to":"5f93b717_364d059a","updated":"2018-01-29 09:36:43.000000000","message":"Done","commit_id":"a39827e309902ed40678b24e4f4087f446c30522"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"971249de461bb5dae3c1346baca397b2fa2ea87c","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                                  None,"},{"line_number":42,"context_line":"                                  segments_to_bind)"},{"line_number":43,"context_line":"        context._binding \u003d mock.Mock(vrf_type\u003dNone,"},{"line_number":44,"context_line":"                                     vrf_details\u003dNone)"},{"line_number":45,"context_line":"        context._binding_levels \u003d []"},{"line_number":46,"context_line":"        context._new_bound_segment \u003d segment_id"},{"line_number":47,"context_line":"        context._next_segments_to_bind \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_5650d132","line":44,"range":{"start_line":44,"start_character":37,"end_line":44,"end_character":40},"updated":"2018-01-29 09:07:21.000000000","message":"vif?","commit_id":"a39827e309902ed40678b24e4f4087f446c30522"},{"author":{"_account_id":18785,"name":"Bo Chi","email":"bochi@tethrnet.com","username":"bochi"},"change_message_id":"d44bab61c6d7d319403a76ae509f4673f55d615a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                                  None,"},{"line_number":42,"context_line":"                                  segments_to_bind)"},{"line_number":43,"context_line":"        context._binding \u003d mock.Mock(vrf_type\u003dNone,"},{"line_number":44,"context_line":"                                     vrf_details\u003dNone)"},{"line_number":45,"context_line":"        context._binding_levels \u003d []"},{"line_number":46,"context_line":"        context._new_bound_segment \u003d segment_id"},{"line_number":47,"context_line":"        context._next_segments_to_bind \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f93b717_510a1b8a","line":44,"range":{"start_line":44,"start_character":37,"end_line":44,"end_character":40},"in_reply_to":"5f93b717_5650d132","updated":"2018-01-29 09:36:43.000000000","message":"Done","commit_id":"a39827e309902ed40678b24e4f4087f446c30522"},{"author":{"_account_id":19853,"name":"Nguyen Hung Phuong","email":"phuongnh@vn.fujitsu.com","username":"phuongnh"},"change_message_id":"3a0431a571550c56a27bacfd12a0badc583b1ef7","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import mock"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron_lib.plugins.ml2 import api"},{"line_number":20,"context_line":"from oslo_config import cfg"},{"line_number":21,"context_line":"from oslo_db import exception as db_exc"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f93b717_c07dbcb2","line":19,"updated":"2018-01-31 06:32:51.000000000","message":"please remove this line to fix pep8 issue","commit_id":"8501f807b88943a2b94f4abd41f48711c15377d6"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4da4bea0de02dcfe20e1d228feebdd69c25538bd","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import mock"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron_lib.plugins.ml2 import api"},{"line_number":20,"context_line":"from oslo_config import cfg"},{"line_number":21,"context_line":"from oslo_db import exception as db_exc"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f93b717_5f38a29e","side":"PARENT","line":19,"updated":"2018-01-31 12:35:29.000000000","message":"why You removed this and replaced usage of constants like SEGMENTATION_ID with hardcoded strings?","commit_id":"639b83264c1f87a558004c174ae41714509ddbce"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"008f4f838901759ec2f75e5cac0a3266be26aefd","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import mock"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron_lib.plugins.ml2 import api"},{"line_number":20,"context_line":"from oslo_config import cfg"},{"line_number":21,"context_line":"from oslo_db import exception as db_exc"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f93b717_b3b9decc","side":"PARENT","line":19,"in_reply_to":"5f93b717_5f38a29e","updated":"2018-01-31 15:26:01.000000000","message":"I have the same question.","commit_id":"639b83264c1f87a558004c174ae41714509ddbce"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"008f4f838901759ec2f75e5cac0a3266be26aefd","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        with mock.patch.object(mech_fake_agent.FakeAgentMechanismDriver,"},{"line_number":49,"context_line":"                               \u0027bind_port\u0027) as bind_port:"},{"line_number":50,"context_line":"            manager._bind_port_level(context, 0, segments_to_bind)"},{"line_number":51,"context_line":"            self.assertEqual(1, bind_port.call_count)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        context._binding_levels \u003d [mock.Mock(port_id\u003d\"port_id\","},{"line_number":54,"context_line":"                                             level\u003d0,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f93b717_33e86ee0","line":51,"range":{"start_line":51,"start_character":12,"end_line":51,"end_character":53},"updated":"2018-01-31 15:26:01.000000000","message":"This can be outside of with-clause and it is recommended because mock.patch is stopped and we can avoid typo of bind_port.call_count.","commit_id":"ad73959d1d6895964f72157dd1045b424cabbea2"},{"author":{"_account_id":18785,"name":"Bo Chi","email":"bochi@tethrnet.com","username":"bochi"},"change_message_id":"0cfe3422d5431076a7c019ba0c07b59485892bcd","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        with mock.patch.object(mech_fake_agent.FakeAgentMechanismDriver,"},{"line_number":49,"context_line":"                               \u0027bind_port\u0027) as bind_port:"},{"line_number":50,"context_line":"            manager._bind_port_level(context, 0, segments_to_bind)"},{"line_number":51,"context_line":"            self.assertEqual(1, bind_port.call_count)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        context._binding_levels \u003d [mock.Mock(port_id\u003d\"port_id\","},{"line_number":54,"context_line":"                                             level\u003d0,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f93b717_ce206f9e","line":51,"range":{"start_line":51,"start_character":12,"end_line":51,"end_character":53},"in_reply_to":"5f93b717_33e86ee0","updated":"2018-02-01 01:46:04.000000000","message":"If I move this line outside of the with-clause, how can I check bind_port is called only once?","commit_id":"ad73959d1d6895964f72157dd1045b424cabbea2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0eed4355fccc01dc066071d8ba69ca7296d8d24b","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        with mock.patch.object(mech_fake_agent.FakeAgentMechanismDriver,"},{"line_number":49,"context_line":"                               \u0027bind_port\u0027) as bind_port:"},{"line_number":50,"context_line":"            manager._bind_port_level(context, 0, segments_to_bind)"},{"line_number":51,"context_line":"            self.assertEqual(1, bind_port.call_count)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        context._binding_levels \u003d [mock.Mock(port_id\u003d\"port_id\","},{"line_number":54,"context_line":"                                             level\u003d0,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f93b717_6e9116f1","line":51,"range":{"start_line":51,"start_character":12,"end_line":51,"end_character":53},"in_reply_to":"5f93b717_ce206f9e","updated":"2018-02-01 07:25:37.000000000","message":"\"bind_port\" variable can be accessed even after exiting with-clause. Exiting with-clause of mock.patch means just stopping mock. You can still access \"bind_port\" and what you need to do is just to change the indent level of L.51.\n\n with mock.patch.object(mech_fake_agent.FakeAgentMechanismDriver,\n                        \u0027bind_port\u0027) as bind_port:\n     manager._bind_port_level(context, 0, segments_to_bind)\n self.assertEqual(1, bind_port.call_count)","commit_id":"ad73959d1d6895964f72157dd1045b424cabbea2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"008f4f838901759ec2f75e5cac0a3266be26aefd","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                               \u0027bind_port\u0027) as bind_port:"},{"line_number":50,"context_line":"            manager._bind_port_level(context, 0, segments_to_bind)"},{"line_number":51,"context_line":"            self.assertEqual(1, bind_port.call_count)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        context._binding_levels \u003d [mock.Mock(port_id\u003d\"port_id\","},{"line_number":54,"context_line":"                                             level\u003d0,"},{"line_number":55,"context_line":"                                             driver\u003d\u0027fake_agent\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f93b717_f39be66f","line":52,"updated":"2018-01-31 15:26:01.000000000","message":"If the test below is not needed to run after the above, it is better to split the below into a separate test.","commit_id":"ad73959d1d6895964f72157dd1045b424cabbea2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"008f4f838901759ec2f75e5cac0a3266be26aefd","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        with mock.patch.object(mech_fake_agent.FakeAgentMechanismDriver,"},{"line_number":59,"context_line":"                               \u0027bind_port\u0027) as bind_port:"},{"line_number":60,"context_line":"            manager._bind_port_level(context, 0, segments_to_bind)"},{"line_number":61,"context_line":"            self.assertEqual(0, bind_port.call_count)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @mock.patch.object(managers.LOG, \u0027critical\u0027)"},{"line_number":64,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_loaded\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f93b717_53e5fa07","line":61,"range":{"start_line":61,"start_character":12,"end_line":61,"end_character":53},"updated":"2018-01-31 15:26:01.000000000","message":"same as the above","commit_id":"ad73959d1d6895964f72157dd1045b424cabbea2"}]}
