)]}'
{"neutron/tests/unit/nec/test_pfc_driver.py":[{"author":{"_account_id":5127,"name":"Justin Hammond","email":"runningempty@gmail.com","username":"justin-hammond"},"change_message_id":"bac75d5d32f6167bc5f1dee38ef8eacdceefd0a6","unresolved":false,"context_lines":[{"line_number":169,"context_line":"    def testa_create_tenant(self):"},{"line_number":170,"context_line":"        t, n, p \u003d self.get_ofc_item_random_params()"},{"line_number":171,"context_line":"        ret \u003d self.driver.create_tenant(\u0027dummy_desc\u0027, t)"},{"line_number":172,"context_line":"        self.assertFalse(self.do_request.call_count)"},{"line_number":173,"context_line":"        ofc_t_path \u003d \"/tenants/\" + self._generate_ofc_tenant_id(t)"},{"line_number":174,"context_line":"        self.assertEqual(ofc_t_path, ret)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Frb8%3D","line":172,"updated":"2013-10-30 16:13:48.000000000","message":"nit: I\u0027d prefer more explicit assertEqual(0, self.do_request.call_count)","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"94c9533ac8ef3946f1bc6c44c0904a1fc8689eb5","unresolved":false,"context_lines":[{"line_number":169,"context_line":"    def testa_create_tenant(self):"},{"line_number":170,"context_line":"        t, n, p \u003d self.get_ofc_item_random_params()"},{"line_number":171,"context_line":"        ret \u003d self.driver.create_tenant(\u0027dummy_desc\u0027, t)"},{"line_number":172,"context_line":"        self.assertFalse(self.do_request.call_count)"},{"line_number":173,"context_line":"        ofc_t_path \u003d \"/tenants/\" + self._generate_ofc_tenant_id(t)"},{"line_number":174,"context_line":"        self.assertEqual(ofc_t_path, ret)"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Fhm4%3D","line":172,"in_reply_to":"AAAATn%2F%2Frb8%3D","updated":"2013-11-02 10:34:17.000000000","message":"Done.\n\nIn Neutron test code, both is used. I was previously suggested to use assertFalse in this case.","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":5127,"name":"Justin Hammond","email":"runningempty@gmail.com","username":"justin-hammond"},"change_message_id":"bac75d5d32f6167bc5f1dee38ef8eacdceefd0a6","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        t, n, p \u003d self.get_ofc_item_random_params()"},{"line_number":178,"context_line":"        path \u003d \"/tenants/%s\" % _ofc(t)"},{"line_number":179,"context_line":"        self.driver.delete_tenant(path)"},{"line_number":180,"context_line":"        self.assertFalse(self.do_request.call_count)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class PFCV4DriverTest(PFCDriverTestBase):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Frb4%3D","line":180,"updated":"2013-10-30 16:13:48.000000000","message":"nit: I\u0027d prefer more explicit assertEqual(0, self.do_request.call_count)","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"}],"neutron/tests/unit/nec/test_trema_driver.py":[{"author":{"_account_id":5127,"name":"Justin Hammond","email":"runningempty@gmail.com","username":"justin-hammond"},"change_message_id":"bac75d5d32f6167bc5f1dee38ef8eacdceefd0a6","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        ofc_t_path \u003d \"/tenants/%s\" % t"},{"line_number":65,"context_line":"        self.assertEqual(ofc_t_path, ret)"},{"line_number":66,"context_line":"        # There is no API call."},{"line_number":67,"context_line":"        self.assertFalse(self.do_request.call_count)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_update_tenant(self):"},{"line_number":70,"context_line":"        t, n, p \u003d self.get_ofc_item_random_params()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2FrNM%3D","line":67,"updated":"2013-10-30 16:13:48.000000000","message":"same nit","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":5127,"name":"Justin Hammond","email":"runningempty@gmail.com","username":"justin-hammond"},"change_message_id":"bac75d5d32f6167bc5f1dee38ef8eacdceefd0a6","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        path \u003d \"/tenants/%s\" % t"},{"line_number":72,"context_line":"        self.driver.update_tenant(path, \u0027dummy_desc\u0027)"},{"line_number":73,"context_line":"        # There is no API call."},{"line_number":74,"context_line":"        self.assertFalse(self.do_request.call_count)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def testc_delete_tenant(self):"},{"line_number":77,"context_line":"        t, n, p \u003d self.get_ofc_item_random_params()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2FrNA%3D","line":74,"updated":"2013-10-30 16:13:48.000000000","message":"same nit and this will be the last one.","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"70cd58a59edda549224509c2c6c377b84146df1c","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def testa_create_network(self):"},{"line_number":84,"context_line":"        t, n, p \u003d self.get_ofc_item_random_params()"},{"line_number":85,"context_line":"        description \u003d \"desc of %s\" % n"},{"line_number":86,"context_line":"        body \u003d {\u0027id\u0027: n, \u0027description\u0027: description}"},{"line_number":87,"context_line":"        ret \u003d self.driver.create_network(t, description, n)"},{"line_number":88,"context_line":"        self.do_request.assert_called_once_with(\"POST\", \"/networks\", body\u003dbody)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FS14%3D","line":85,"updated":"2013-11-11 17:19:04.000000000","message":"Would prefer not to see gratuitous whitespace changes like removing these lines.  But, I won\u0027t -1 for just this.  There are a number of these throughout the file.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ac58388e702bf5a086c480bf71da2235a66f0d75","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def testa_create_network(self):"},{"line_number":84,"context_line":"        t, n, p \u003d self.get_ofc_item_random_params()"},{"line_number":85,"context_line":"        description \u003d \"desc of %s\" % n"},{"line_number":86,"context_line":"        body \u003d {\u0027id\u0027: n, \u0027description\u0027: description}"},{"line_number":87,"context_line":"        ret \u003d self.driver.create_network(t, description, n)"},{"line_number":88,"context_line":"        self.do_request.assert_called_once_with(\"POST\", \"/networks\", body\u003dbody)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FOik%3D","line":85,"in_reply_to":"AAAATn%2F%2FS14%3D","updated":"2013-11-12 15:58:24.000000000","message":"Ah, sorry. I am the original author of this file and tried to remove blank lines for short test cases.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"70cd58a59edda549224509c2c6c377b84146df1c","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        path_3 \u003d \"/networks/%s/ports/%s\" % (n, dummy_port)"},{"line_number":144,"context_line":"        port_path \u003d \"/networks/%s/ports/%s/attachments/%s\" % (n, dummy_port,"},{"line_number":145,"context_line":"                                                              p.id)"},{"line_number":146,"context_line":"        ret \u003d self.driver.create_port(net_path, p, p.id)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        self.do_request.assert_has_calls(["},{"line_number":149,"context_line":"            mock.call(\"POST\", path_1, body\u003dbody_1),"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FS2k%3D","line":146,"updated":"2013-11-11 17:19:04.000000000","message":"Try not to make gratuitous changes like moving this line out of its original place.  Gerrit highlights this as a change causing reviewers to pause to try to figure out why lines were reordered.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ac58388e702bf5a086c480bf71da2235a66f0d75","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        path_3 \u003d \"/networks/%s/ports/%s\" % (n, dummy_port)"},{"line_number":144,"context_line":"        port_path \u003d \"/networks/%s/ports/%s/attachments/%s\" % (n, dummy_port,"},{"line_number":145,"context_line":"                                                              p.id)"},{"line_number":146,"context_line":"        ret \u003d self.driver.create_port(net_path, p, p.id)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        self.do_request.assert_has_calls(["},{"line_number":149,"context_line":"            mock.call(\"POST\", path_1, body\u003dbody_1),"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FOhU%3D","line":146,"in_reply_to":"AAAATn%2F%2FS2k%3D","updated":"2013-11-12 15:58:24.000000000","message":"Sorry. It is not intentional. If I have another round of review, i will update it.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"}],"neutron/tests/unit/openvswitch/test_ovs_lib.py":[{"author":{"_account_id":7203,"name":"yuuichi fujioka","email":"fujioka.yuuichi@gmail.com","username":"FujiokaYuuichi"},"change_message_id":"bfd121f50c43f111ac75bf30e9472c4ec0e7fc43","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        expected_calls_and_values \u003d ["},{"line_number":499,"context_line":"            (mock.call([\"ovs-vsctl\", self.TO, \"list-ports\", self.BR_NAME],"},{"line_number":500,"context_line":"                       root_helper\u003dself.root_helper),"},{"line_number":501,"context_line":"             \u0027tap99\\n\u0027),"},{"line_number":502,"context_line":"            (mock.call([\"ovs-vsctl\", self.TO, \"--format\u003djson\","},{"line_number":503,"context_line":"                        \"--\", \"--columns\u003dname,external_ids\","},{"line_number":504,"context_line":"                        \"list\", \"Interface\"],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FxqQ%3D","line":501,"updated":"2013-10-29 08:33:40.000000000","message":"old code raises text.\nnew code seemed returning text.\n\nyou might want to following code:\n\n def make_side_effect():\n  def dummy(*args, **kwargs):\n    dummy.call_count +\u003d 1\n    if dummy.call_count \u003d\u003d 1:\n      raise \u0027tap99\\n\u0027\n    elif dummy.call_count \u003d\u003d 2:\n      raise RuntimeError()\n  dummy_execute.call_count \u003d 0\n  return dummy_execute\n   \n self.execute.side_effect \u003d make_side_effect()","commit_id":"ab48fc29c1458caf61eb493b19a106f9d1744069"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7d80d73116089f9e6f8fd9f6c491ca44dbc6be27","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        expected_calls_and_values \u003d ["},{"line_number":499,"context_line":"            (mock.call([\"ovs-vsctl\", self.TO, \"list-ports\", self.BR_NAME],"},{"line_number":500,"context_line":"                       root_helper\u003dself.root_helper),"},{"line_number":501,"context_line":"             \u0027tap99\\n\u0027),"},{"line_number":502,"context_line":"            (mock.call([\"ovs-vsctl\", self.TO, \"--format\u003djson\","},{"line_number":503,"context_line":"                        \"--\", \"--columns\u003dname,external_ids\","},{"line_number":504,"context_line":"                        \"list\", \"Interface\"],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FxE0%3D","line":501,"in_reply_to":"AAAATn%2F%2FxqQ%3D","updated":"2013-10-29 11:17:27.000000000","message":"The old code looks strange and it is not a valid mox sentence, so I think it is a typo of AndReturn. The test code itself should be valid and should not raise any error. The same thing can apply to your sample code (raise \u0027tap99\\n\u0027 is invalid.\n\nIf you see ovs_lib.get_vif_port_set(), it is obvious this test tries to check the behavior when the second ovs-vsctl fails.\n\nThis is the reason I wrote the above code.","commit_id":"ab48fc29c1458caf61eb493b19a106f9d1744069"},{"author":{"_account_id":7203,"name":"yuuichi fujioka","email":"fujioka.yuuichi@gmail.com","username":"FujiokaYuuichi"},"change_message_id":"bfd121f50c43f111ac75bf30e9472c4ec0e7fc43","unresolved":false,"context_lines":[{"line_number":560,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":561,"context_line":"                self.br.delete_ports(all_ports\u003dTrue)"},{"line_number":562,"context_line":"                get_port.assert_called_once_with()"},{"line_number":563,"context_line":"                delete_port(\u0027port1\u0027)"},{"line_number":564,"context_line":""},{"line_number":565,"context_line":"    def test_delete_neutron_ports(self):"},{"line_number":566,"context_line":"        port1 \u003d ovs_lib.VifPort(\u0027tap1234\u0027, 1, uuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FxnA%3D","line":563,"updated":"2013-10-29 08:33:40.000000000","message":"delete_port.assert_called_once_with(\u0027port1\u0027) ?","commit_id":"ab48fc29c1458caf61eb493b19a106f9d1744069"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"347306d896c83411ba37ebee9006fe88bc8de19f","unresolved":false,"context_lines":[{"line_number":560,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":561,"context_line":"                self.br.delete_ports(all_ports\u003dTrue)"},{"line_number":562,"context_line":"                get_port.assert_called_once_with()"},{"line_number":563,"context_line":"                delete_port(\u0027port1\u0027)"},{"line_number":564,"context_line":""},{"line_number":565,"context_line":"    def test_delete_neutron_ports(self):"},{"line_number":566,"context_line":"        port1 \u003d ovs_lib.VifPort(\u0027tap1234\u0027, 1, uuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FtxU%3D","line":563,"in_reply_to":"AAAATn%2F%2FxC4%3D","updated":"2013-10-30 03:06:49.000000000","message":"Done","commit_id":"ab48fc29c1458caf61eb493b19a106f9d1744069"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7d80d73116089f9e6f8fd9f6c491ca44dbc6be27","unresolved":false,"context_lines":[{"line_number":560,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":561,"context_line":"                self.br.delete_ports(all_ports\u003dTrue)"},{"line_number":562,"context_line":"                get_port.assert_called_once_with()"},{"line_number":563,"context_line":"                delete_port(\u0027port1\u0027)"},{"line_number":564,"context_line":""},{"line_number":565,"context_line":"    def test_delete_neutron_ports(self):"},{"line_number":566,"context_line":"        port1 \u003d ovs_lib.VifPort(\u0027tap1234\u0027, 1, uuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FxC4%3D","line":563,"in_reply_to":"AAAATn%2F%2FxnA%3D","updated":"2013-10-29 11:17:27.000000000","message":"will fix","commit_id":"ab48fc29c1458caf61eb493b19a106f9d1744069"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"70cd58a59edda549224509c2c6c377b84146df1c","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                               return_value\u003d[\u0027port1\u0027]) as get_port:"},{"line_number":550,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":551,"context_line":"                self.br.delete_ports(all_ports\u003dTrue)"},{"line_number":552,"context_line":"        get_port.assert_called_once_with()"},{"line_number":553,"context_line":"        delete_port.assert_called_once_with(\u0027port1\u0027)"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"    def test_delete_neutron_ports(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FSw8%3D","line":552,"updated":"2013-11-11 17:19:04.000000000","message":"It fools like these should be indented to match the indentation of the \"with mock.patch... as ...\" calls above.\n\nI think it is all fine with python\u0027s scoping rules so I\u0027ll leave it up to you.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"5ac76a65606a37138fd9a43ab89f4ff1d1cee024","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                               return_value\u003d[\u0027port1\u0027]) as get_port:"},{"line_number":550,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":551,"context_line":"                self.br.delete_ports(all_ports\u003dTrue)"},{"line_number":552,"context_line":"        get_port.assert_called_once_with()"},{"line_number":553,"context_line":"        delete_port.assert_called_once_with(\u0027port1\u0027)"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"    def test_delete_neutron_ports(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FOcA%3D","line":552,"in_reply_to":"AAAATn%2F%2FOjA%3D","updated":"2013-11-12 16:27:55.000000000","message":"Fair enough.  Thanks for pointing out the examples.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ac58388e702bf5a086c480bf71da2235a66f0d75","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                               return_value\u003d[\u0027port1\u0027]) as get_port:"},{"line_number":550,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":551,"context_line":"                self.br.delete_ports(all_ports\u003dTrue)"},{"line_number":552,"context_line":"        get_port.assert_called_once_with()"},{"line_number":553,"context_line":"        delete_port.assert_called_once_with(\u0027port1\u0027)"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"    def test_delete_neutron_ports(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FOjA%3D","line":552,"in_reply_to":"AAAATn%2F%2FSw8%3D","updated":"2013-11-12 15:58:24.000000000","message":"When using mock.patch \"with\" statement, mock is started inside with statement and stopped when exiting the with statement. Variables referred with \"as\" (such as get_ports here) are valid even after exiting \"with\" statement. I believe it is a valid usage.\n\nhttp://www.voidspace.org.uk/python/mock/examples.html has good examples.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"70cd58a59edda549224509c2c6c377b84146df1c","unresolved":false,"context_lines":[{"line_number":561,"context_line":"                               return_value\u003d[port1, port2]) as get_ports:"},{"line_number":562,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":563,"context_line":"                self.br.delete_ports(all_ports\u003dFalse)"},{"line_number":564,"context_line":"        get_ports.assert_called_once_with()"},{"line_number":565,"context_line":"        delete_port.assert_has_calls(["},{"line_number":566,"context_line":"            mock.call(\u0027tap1234\u0027),"},{"line_number":567,"context_line":"            mock.call(\u0027tap5678\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FSw0%3D","line":564,"updated":"2013-11-11 17:19:04.000000000","message":"Indent?","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"5ac76a65606a37138fd9a43ab89f4ff1d1cee024","unresolved":false,"context_lines":[{"line_number":561,"context_line":"                               return_value\u003d[port1, port2]) as get_ports:"},{"line_number":562,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":563,"context_line":"                self.br.delete_ports(all_ports\u003dFalse)"},{"line_number":564,"context_line":"        get_ports.assert_called_once_with()"},{"line_number":565,"context_line":"        delete_port.assert_has_calls(["},{"line_number":566,"context_line":"            mock.call(\u0027tap1234\u0027),"},{"line_number":567,"context_line":"            mock.call(\u0027tap5678\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FOb8%3D","line":564,"in_reply_to":"AAAATn%2F%2FOjE%3D","updated":"2013-11-12 16:27:55.000000000","message":"Same reply as above.  Thanks.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ac58388e702bf5a086c480bf71da2235a66f0d75","unresolved":false,"context_lines":[{"line_number":561,"context_line":"                               return_value\u003d[port1, port2]) as get_ports:"},{"line_number":562,"context_line":"            with mock.patch.object(self.br, \u0027delete_port\u0027) as delete_port:"},{"line_number":563,"context_line":"                self.br.delete_ports(all_ports\u003dFalse)"},{"line_number":564,"context_line":"        get_ports.assert_called_once_with()"},{"line_number":565,"context_line":"        delete_port.assert_has_calls(["},{"line_number":566,"context_line":"            mock.call(\u0027tap1234\u0027),"},{"line_number":567,"context_line":"            mock.call(\u0027tap5678\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FOjE%3D","line":564,"in_reply_to":"AAAATn%2F%2FSw0%3D","updated":"2013-11-12 15:58:24.000000000","message":"Same as the above","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"}],"neutron/tests/unit/openvswitch/test_ovs_tunnel.py":[{"author":{"_account_id":7203,"name":"yuuichi fujioka","email":"fujioka.yuuichi@gmail.com","username":"FujiokaYuuichi"},"change_message_id":"4b62e7150967bac9f4e5cf1eade1f548d757cd9a","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.inta \u003d mock.Mock()"},{"line_number":84,"context_line":"        self.intb \u003d mock.Mock()"},{"line_number":85,"context_line":"        self.inta.link \u003d mock.Mock()"},{"line_number":86,"context_line":"        self.intb.link \u003d mock.Mock()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        self.ovs_bridges \u003d {}"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2FouI%3D","line":86,"updated":"2013-10-31 04:49:46.000000000","message":"Is this necessary?\n\ninta.link and intb.link will return mock.Mock, even if doesn\u0027t set mock.Mock.","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"94c9533ac8ef3946f1bc6c44c0904a1fc8689eb5","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.inta \u003d mock.Mock()"},{"line_number":84,"context_line":"        self.intb \u003d mock.Mock()"},{"line_number":85,"context_line":"        self.inta.link \u003d mock.Mock()"},{"line_number":86,"context_line":"        self.intb.link \u003d mock.Mock()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        self.ovs_bridges \u003d {}"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2FhpY%3D","line":86,"in_reply_to":"AAAATn%2F%2FouI%3D","updated":"2013-11-02 10:34:17.000000000","message":"Done","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":7203,"name":"yuuichi fujioka","email":"fujioka.yuuichi@gmail.com","username":"FujiokaYuuichi"},"change_message_id":"4b62e7150967bac9f4e5cf1eade1f548d757cd9a","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            return self.ovs_bridges[br_name]"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        self.mock_bridge \u003d mock.patch.object(ovs_lib, \u0027OVSBridge\u0027).start()"},{"line_number":96,"context_line":"        self.mock_bridge.side_effect \u003d mock_bridge_side_effect"},{"line_number":97,"context_line":"        self.mock_bridge_expected \u003d ["},{"line_number":98,"context_line":"            mock.call(self.INT_BRIDGE, \u0027sudo\u0027),"},{"line_number":99,"context_line":"            mock.call(self.MAP_TUN_BRIDGE, \u0027sudo\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2FpO8%3D","line":96,"updated":"2013-10-31 04:49:46.000000000","message":"I propose other way:\n\n self.mock_bridges.side_effect \u003d labmda name, helper: getattr(self.mock_bridges, name)","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"94c9533ac8ef3946f1bc6c44c0904a1fc8689eb5","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            return self.ovs_bridges[br_name]"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        self.mock_bridge \u003d mock.patch.object(ovs_lib, \u0027OVSBridge\u0027).start()"},{"line_number":96,"context_line":"        self.mock_bridge.side_effect \u003d mock_bridge_side_effect"},{"line_number":97,"context_line":"        self.mock_bridge_expected \u003d ["},{"line_number":98,"context_line":"            mock.call(self.INT_BRIDGE, \u0027sudo\u0027),"},{"line_number":99,"context_line":"            mock.call(self.MAP_TUN_BRIDGE, \u0027sudo\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Fhps%3D","line":96,"in_reply_to":"AAAATn%2F%2FpO8%3D","updated":"2013-11-02 10:34:17.000000000","message":"After further investigation, the approach to create mocked OVSBridge instance does not work because self.mock_bridge is called in this test code and it changes call_count. Thus I backed to the original apparch to create mock.Mock for each OVSBridge instance (TUN_BRIDGE, INT_BRIDGE, MAP_TUN_BRIDGE).","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"94c9533ac8ef3946f1bc6c44c0904a1fc8689eb5","unresolved":false,"context_lines":[{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def _verify_mock_call(self, mock_obj, expected):"},{"line_number":219,"context_line":"        mock_obj.assert_has_calls(expected)"},{"line_number":220,"context_line":"        # self.assertEqual(len(mock_obj.mock_calls), len(expected))"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def _verify_mock_calls(self):"},{"line_number":223,"context_line":"        self._verify_mock_call(self.mock_bridge, self.mock_bridge_expected)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Fho4%3D","line":220,"updated":"2013-11-02 10:34:17.000000000","message":"I forgot to enable this. Fixed.","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"94c9533ac8ef3946f1bc6c44c0904a1fc8689eb5","unresolved":false,"context_lines":[{"line_number":548,"context_line":"        super(TunnelTestWithMTU, self).setUp()"},{"line_number":549,"context_line":"        self.VETH_MTU \u003d 1500"},{"line_number":550,"context_line":"        self.inta.link.set_mtu(self.VETH_MTU)"},{"line_number":551,"context_line":"        self.intb.link.set_mtu(self.VETH_MTU)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2Fho0%3D","line":551,"updated":"2013-11-02 10:34:17.000000000","message":"Fixed. These two lines needs to be replaced with mock.","commit_id":"5aafb1f562fdfe43ddb55e8fdec79cf5c5b63cff"}],"neutron/tests/unit/test_iptables_manager.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"70cd58a59edda549224509c2c6c377b84146df1c","unresolved":false,"context_lines":[{"line_number":479,"context_line":"            acc \u003d self.iptables.get_traffic_counters(\u0027chain1\u0027)"},{"line_number":480,"context_line":"            self.assertIsNone(acc)"},{"line_number":481,"context_line":"        self.assertEqual(0, self.execute.call_count)"},{"line_number":482,"context_line":"        log.warn.assert_called_once_with("},{"line_number":483,"context_line":"            \u0027Attempted to get traffic counters of chain %s which \u0027"},{"line_number":484,"context_line":"            \u0027does not exist\u0027, \u0027chain1\u0027)"},{"line_number":485,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FSVM%3D","line":482,"updated":"2013-11-11 17:19:04.000000000","message":"Indent?","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"5ac76a65606a37138fd9a43ab89f4ff1d1cee024","unresolved":false,"context_lines":[{"line_number":479,"context_line":"            acc \u003d self.iptables.get_traffic_counters(\u0027chain1\u0027)"},{"line_number":480,"context_line":"            self.assertIsNone(acc)"},{"line_number":481,"context_line":"        self.assertEqual(0, self.execute.call_count)"},{"line_number":482,"context_line":"        log.warn.assert_called_once_with("},{"line_number":483,"context_line":"            \u0027Attempted to get traffic counters of chain %s which \u0027"},{"line_number":484,"context_line":"            \u0027does not exist\u0027, \u0027chain1\u0027)"},{"line_number":485,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FOb4%3D","line":482,"in_reply_to":"AAAATn%2F%2FOi8%3D","updated":"2013-11-12 16:27:55.000000000","message":"Thanks.","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ac58388e702bf5a086c480bf71da2235a66f0d75","unresolved":false,"context_lines":[{"line_number":479,"context_line":"            acc \u003d self.iptables.get_traffic_counters(\u0027chain1\u0027)"},{"line_number":480,"context_line":"            self.assertIsNone(acc)"},{"line_number":481,"context_line":"        self.assertEqual(0, self.execute.call_count)"},{"line_number":482,"context_line":"        log.warn.assert_called_once_with("},{"line_number":483,"context_line":"            \u0027Attempted to get traffic counters of chain %s which \u0027"},{"line_number":484,"context_line":"            \u0027does not exist\u0027, \u0027chain1\u0027)"},{"line_number":485,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2FOi8%3D","line":482,"in_reply_to":"AAAATn%2F%2FSVM%3D","updated":"2013-11-12 15:58:24.000000000","message":"replied in test_ovs_lib","commit_id":"92d2d2789e58021c5c8538ec69cfaca4a11981ce"}]}
