)]}'
{"neutron/tests/unit/db/test_dvr_mac_db.py":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"c8aede8c03c13ac0b9f8041c9c982211f95617dc","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def test_mac_cleared_on_agent_delete_event(self):"},{"line_number":96,"context_line":"        plugin \u003d directory.get_plugin()"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        with db_api.context_manager.writer.using(self.ctx):"},{"line_number":99,"context_line":"            self._create_dvr_mac_entry(\u0027host_1\u0027, \u0027mac_1\u0027)"},{"line_number":100,"context_line":"            self._create_dvr_mac_entry(\u0027host_2\u0027, \u0027mac_2\u0027)"},{"line_number":101,"context_line":"            agent \u003d {\u0027host\u0027: \u0027host_1\u0027, \u0027id\u0027: \u0027a1\u0027}"},{"line_number":102,"context_line":"            with mock.patch.object(plugin, \u0027notifier\u0027) as notifier:"},{"line_number":103,"context_line":"                registry.notify(resources.AGENT, events.BEFORE_DELETE, self,"},{"line_number":104,"context_line":"                                context\u003dself.ctx, agent\u003dagent)"},{"line_number":105,"context_line":"            mac_list \u003d self.mixin.get_dvr_mac_address_list(self.ctx)"},{"line_number":106,"context_line":"        self.assertEqual(1, len(mac_list))"},{"line_number":107,"context_line":"        self.assertEqual(\u0027host_2\u0027, mac_list[0][\u0027host\u0027])"},{"line_number":108,"context_line":"        notifier.dvr_mac_address_update.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_c9f51acc","line":105,"range":{"start_line":98,"start_character":8,"end_line":105,"end_character":68},"updated":"2016-12-08 08:52:56.000000000","message":"I faced the issue here:\nassert_called_once_with failed on line 108 as mac_list and created dvr_mac_entry are in different sessions, so from the point assertEqual they are not the same. Surrounding creation and get with session - resolve this problem, but this is not good and in some places we won\u0027t be able to do it:) The solution could be rewrite __eq__ (probably using matches). What do you think about this?","commit_id":"5d82f3f7e7c898ef2603e1e7d1906db0591cac31"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c2e51233e3eae4d0cde45076004d04071b05c880","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def test_mac_cleared_on_agent_delete_event(self):"},{"line_number":96,"context_line":"        plugin \u003d directory.get_plugin()"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        with db_api.context_manager.writer.using(self.ctx):"},{"line_number":99,"context_line":"            self._create_dvr_mac_entry(\u0027host_1\u0027, \u0027mac_1\u0027)"},{"line_number":100,"context_line":"            self._create_dvr_mac_entry(\u0027host_2\u0027, \u0027mac_2\u0027)"},{"line_number":101,"context_line":"            agent \u003d {\u0027host\u0027: \u0027host_1\u0027, \u0027id\u0027: \u0027a1\u0027}"},{"line_number":102,"context_line":"            with mock.patch.object(plugin, \u0027notifier\u0027) as notifier:"},{"line_number":103,"context_line":"                registry.notify(resources.AGENT, events.BEFORE_DELETE, self,"},{"line_number":104,"context_line":"                                context\u003dself.ctx, agent\u003dagent)"},{"line_number":105,"context_line":"            mac_list \u003d self.mixin.get_dvr_mac_address_list(self.ctx)"},{"line_number":106,"context_line":"        self.assertEqual(1, len(mac_list))"},{"line_number":107,"context_line":"        self.assertEqual(\u0027host_2\u0027, mac_list[0][\u0027host\u0027])"},{"line_number":108,"context_line":"        notifier.dvr_mac_address_update.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5201f7_d9af8e29","line":105,"range":{"start_line":98,"start_character":8,"end_line":105,"end_character":68},"in_reply_to":"3a71b18c_c9f51acc","updated":"2017-01-10 11:31:36.000000000","message":"I don\u0027t think we care what context L108 is called with. Just change self.ctx to mock.ANY","commit_id":"5d82f3f7e7c898ef2603e1e7d1906db0591cac31"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"96ef975dbe9b05649de9582c1b34cb18e9ee9318","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    def test_mac_cleared_on_agent_delete_event(self):"},{"line_number":96,"context_line":"        plugin \u003d directory.get_plugin()"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        with db_api.context_manager.writer.using(self.ctx):"},{"line_number":99,"context_line":"            self._create_dvr_mac_entry(\u0027host_1\u0027, \u0027mac_1\u0027)"},{"line_number":100,"context_line":"            self._create_dvr_mac_entry(\u0027host_2\u0027, \u0027mac_2\u0027)"},{"line_number":101,"context_line":"            agent \u003d {\u0027host\u0027: \u0027host_1\u0027, \u0027id\u0027: \u0027a1\u0027}"},{"line_number":102,"context_line":"            with mock.patch.object(plugin, \u0027notifier\u0027) as notifier:"},{"line_number":103,"context_line":"                registry.notify(resources.AGENT, events.BEFORE_DELETE, self,"},{"line_number":104,"context_line":"                                context\u003dself.ctx, agent\u003dagent)"},{"line_number":105,"context_line":"            mac_list \u003d self.mixin.get_dvr_mac_address_list(self.ctx)"},{"line_number":106,"context_line":"        self.assertEqual(1, len(mac_list))"},{"line_number":107,"context_line":"        self.assertEqual(\u0027host_2\u0027, mac_list[0][\u0027host\u0027])"},{"line_number":108,"context_line":"        notifier.dvr_mac_address_update.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5201f7_0899bf6e","line":105,"range":{"start_line":98,"start_character":8,"end_line":105,"end_character":68},"in_reply_to":"ba5201f7_d9af8e29","updated":"2017-01-10 12:41:31.000000000","message":"The problem not in context, but in mac_list. When I put add \"with db_api.context_manager.writer.using(self.ctx):\" lines 99, 100 and 105 attached for one session, but if we don\u0027t have it mac_list will be in other one.","commit_id":"5d82f3f7e7c898ef2603e1e7d1906db0591cac31"}]}
