)]}'
{"neutron/tests/unit/db/firewall/test_db_firewall.py":[{"author":{"_account_id":7317,"name":"Bo Lin","email":"linb@vmware.com","username":"berlin"},"change_message_id":"8c9f5107a128d6cec64e83366d6d66db6b9780d1","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def delete_firewall(self, context, firewall):"},{"line_number":71,"context_line":"        self.plugin \u003d NeutronManager.get_service_plugins()[\u0027FIREWALL\u0027]"},{"line_number":72,"context_line":"        self.firewall_deleted(context, firewall[\u0027id\u0027])"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"class FirewallPluginDbTestCase(test_db_plugin.NeutronDbPluginV2TestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2FcJk%3D","line":72,"updated":"2014-03-06 02:54:20.000000000","message":"1. why don\u0027t just mock delete_firewall in fw_plugin, and replace delete_firewall with firewall_deleted implementation? \n2. IMO, the mock ops should move to test_fwaas_plugin.py since DB_FW_PLUGIN_KLASS doesn\u0027t need it.","commit_id":"25573b32775c804398a2d1ce1d47b9c7aade5c33"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c8412b4939e77d3f33da4f2cf6660724ed2e432d","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def delete_firewall(self, context, firewall):"},{"line_number":71,"context_line":"        self.plugin \u003d NeutronManager.get_service_plugins()[\u0027FIREWALL\u0027]"},{"line_number":72,"context_line":"        self.firewall_deleted(context, firewall[\u0027id\u0027])"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"class FirewallPluginDbTestCase(test_db_plugin.NeutronDbPluginV2TestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2FcEA%3D","line":72,"in_reply_to":"AAAAVn%2F%2FcJk%3D","updated":"2014-03-06 03:12:36.000000000","message":"1. Then it wouldn\u0027t be exercising the delete_firewall routine in the plugin or the firewall_deleted callback. With this setup, all of the plugin code still gets exercised, the only thing not exercised is the rpc call, which isn\u0027t part of these tests anyway. It wouldn\u0027t be much easier to do that mock anyway because \u0027self\u0027 in firewall_deleted doesn\u0027t refer to the plugin object, so it would require a translation layer just like this one.\n\n2. I\u0027m not sure what you mean here. There are tests in this file as well that create firewalls that should be cleaned up. So it made the most sense to me to put the mock in the base test case that they all use to avoid code duplication.","commit_id":"25573b32775c804398a2d1ce1d47b9c7aade5c33"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"f1f0db899859590a7bf32fc084ff5ddd926fd2e5","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db.firewall import firewall_db as fdb"},{"line_number":30,"context_line":"import neutron.extensions"},{"line_number":31,"context_line":"from neutron.extensions import firewall"},{"line_number":32,"context_line":"from neutron.manager import NeutronManager"},{"line_number":33,"context_line":"from neutron.openstack.common import importutils"},{"line_number":34,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":35,"context_line":"from neutron.plugins.common import constants"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FBbo%3D","line":32,"updated":"2014-03-10 16:49:38.000000000","message":"Preferred style in HACKING.rst is to import module vs class.\n\nfrom neutron import manager","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"129245aa44ff0088842f4bb115367a009ca61343","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db.firewall import firewall_db as fdb"},{"line_number":30,"context_line":"import neutron.extensions"},{"line_number":31,"context_line":"from neutron.extensions import firewall"},{"line_number":32,"context_line":"from neutron.manager import NeutronManager"},{"line_number":33,"context_line":"from neutron.openstack.common import importutils"},{"line_number":34,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":35,"context_line":"from neutron.plugins.common import constants"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2B%2FkY%3D","line":32,"in_reply_to":"AAAAVn%2F%2FBbo%3D","updated":"2014-03-10 20:30:09.000000000","message":"Done","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"f1f0db899859590a7bf32fc084ff5ddd926fd2e5","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from neutron.openstack.common import importutils"},{"line_number":34,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":35,"context_line":"from neutron.plugins.common import constants"},{"line_number":36,"context_line":"from neutron.services.firewall.fwaas_plugin import FirewallCallbacks"},{"line_number":37,"context_line":"from neutron.tests.unit import test_db_plugin"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FBbk%3D","line":36,"updated":"2014-03-10 16:49:38.000000000","message":"Same as above.","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"129245aa44ff0088842f4bb115367a009ca61343","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from neutron.openstack.common import importutils"},{"line_number":34,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":35,"context_line":"from neutron.plugins.common import constants"},{"line_number":36,"context_line":"from neutron.services.firewall.fwaas_plugin import FirewallCallbacks"},{"line_number":37,"context_line":"from neutron.tests.unit import test_db_plugin"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2B%2Fj8%3D","line":36,"in_reply_to":"AAAAVn%2F%2FBbk%3D","updated":"2014-03-10 20:30:09.000000000","message":"Done","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"f1f0db899859590a7bf32fc084ff5ddd926fd2e5","unresolved":false,"context_lines":[{"line_number":58,"context_line":"ADMIN_STATE_UP \u003d True"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"class FakeAgentApi(FirewallCallbacks):"},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    Fake glue layer that patches plugin plugin-to-agent RPC calls directly"},{"line_number":64,"context_line":"    into the expected resulting agent-to-plugin RPC calls."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FBWc%3D","line":61,"updated":"2014-03-10 16:49:38.000000000","message":"This class can go away.  See below.","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8792ecd5fa7d18630a1f318a163c26eda7864504","unresolved":false,"context_lines":[{"line_number":58,"context_line":"ADMIN_STATE_UP \u003d True"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"class FakeAgentApi(FirewallCallbacks):"},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    Fake glue layer that patches plugin plugin-to-agent RPC calls directly"},{"line_number":64,"context_line":"    into the expected resulting agent-to-plugin RPC calls."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2B%2BMY%3D","line":61,"in_reply_to":"AAAAVn%2F%2B%2Fgs%3D","updated":"2014-03-10 23:26:58.000000000","message":"Actually, this class was necessary because normally the agent API doesn\u0027t have access to the FirewallCallBacks methods. It needs access to them to automatically clean up the DB. Normally the agent response is what triggers the callbacks but there is no agent in the UT.","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"129245aa44ff0088842f4bb115367a009ca61343","unresolved":false,"context_lines":[{"line_number":58,"context_line":"ADMIN_STATE_UP \u003d True"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"class FakeAgentApi(FirewallCallbacks):"},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    Fake glue layer that patches plugin plugin-to-agent RPC calls directly"},{"line_number":64,"context_line":"    into the expected resulting agent-to-plugin RPC calls."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2B%2Fgs%3D","line":61,"in_reply_to":"AAAAVn%2F%2FBWc%3D","updated":"2014-03-10 20:30:09.000000000","message":"Done. I had this as a class to allow easy mocking of the other methods in possible future unit tests.","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"f1f0db899859590a7bf32fc084ff5ddd926fd2e5","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    def __init__(self):"},{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def delete_firewall(self, context, firewall):"},{"line_number":71,"context_line":"        self.plugin \u003d NeutronManager.get_service_plugins()[\u0027FIREWALL\u0027]"},{"line_number":72,"context_line":"        self.firewall_deleted(context, firewall[\u0027id\u0027])"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FBXQ%3D","line":70,"updated":"2014-03-10 16:49:38.000000000","message":"This method does not be defined within a class.  Additionally, the \nmock does match original methods signature.\n\nOriginal:\ndef firewall_deleted(self, context, firewall_id, **kwargs):\n\n\ndef mock_delete_firewall(original_self, context, firewall_id, **kwargs):\n    original_self.plugin \u003d ...\n    original_self.firewall_deleted(...)","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"129245aa44ff0088842f4bb115367a009ca61343","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    def __init__(self):"},{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def delete_firewall(self, context, firewall):"},{"line_number":71,"context_line":"        self.plugin \u003d NeutronManager.get_service_plugins()[\u0027FIREWALL\u0027]"},{"line_number":72,"context_line":"        self.firewall_deleted(context, firewall[\u0027id\u0027])"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2B%2Fgo%3D","line":70,"in_reply_to":"AAAAVn%2F%2FBXQ%3D","updated":"2014-03-10 20:30:09.000000000","message":"Done","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"f1f0db899859590a7bf32fc084ff5ddd926fd2e5","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def setUp(self, core_plugin\u003dNone, fw_plugin\u003dNone, ext_mgr\u003dNone):"},{"line_number":82,"context_line":"        self.agentapi_delf_p \u003d mock.patch(DELETEFW_PATH, create\u003dTrue,"},{"line_number":83,"context_line":"                                          new\u003dFakeAgentApi().delete_firewall)"},{"line_number":84,"context_line":"        self.agentapi_delf_p.start()"},{"line_number":85,"context_line":"        self.addCleanup(mock.patch.stopall)"},{"line_number":86,"context_line":"        if not fw_plugin:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FBXM%3D","line":83,"updated":"2014-03-10 16:49:38.000000000","message":"new \u003d mock_delete_firewall","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"129245aa44ff0088842f4bb115367a009ca61343","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def setUp(self, core_plugin\u003dNone, fw_plugin\u003dNone, ext_mgr\u003dNone):"},{"line_number":82,"context_line":"        self.agentapi_delf_p \u003d mock.patch(DELETEFW_PATH, create\u003dTrue,"},{"line_number":83,"context_line":"                                          new\u003dFakeAgentApi().delete_firewall)"},{"line_number":84,"context_line":"        self.agentapi_delf_p.start()"},{"line_number":85,"context_line":"        self.addCleanup(mock.patch.stopall)"},{"line_number":86,"context_line":"        if not fw_plugin:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2B%2Fgk%3D","line":83,"in_reply_to":"AAAAVn%2F%2FBXM%3D","updated":"2014-03-10 20:30:09.000000000","message":"Done","commit_id":"31ce563973d28d2759a2b1e3c3c884d3bb1f7cea"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"3f129b90eca447183d5627294f2a07284dc8012f","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        self.agentapi_delf_p \u003d mock.patch(DELETEFW_PATH, create\u003dTrue,"},{"line_number":86,"context_line":"                                          new\u003dFakeAgentApi().delete_firewall)"},{"line_number":87,"context_line":"        self.agentapi_delf_p.start()"},{"line_number":88,"context_line":"        self.addCleanup(mock.patch.stopall)"},{"line_number":89,"context_line":"        if not fw_plugin:"},{"line_number":90,"context_line":"            fw_plugin \u003d DB_FW_PLUGIN_KLASS"},{"line_number":91,"context_line":"        service_plugins \u003d {\u0027fw_plugin_name\u0027: fw_plugin}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F%2F8qY%3D","line":88,"updated":"2014-03-12 18:41:37.000000000","message":"This will need a rebase once one the other change merges.","commit_id":"8e4c03f5ebd48a6fdafcf8e07d9e34443c0e9562"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"f7d26cf63e9f24449cca32614f6c1b53e33ccaae","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        self.agentapi_delf_p \u003d mock.patch(DELETEFW_PATH, create\u003dTrue,"},{"line_number":86,"context_line":"                                          new\u003dFakeAgentApi().delete_firewall)"},{"line_number":87,"context_line":"        self.agentapi_delf_p.start()"},{"line_number":88,"context_line":"        self.addCleanup(mock.patch.stopall)"},{"line_number":89,"context_line":"        if not fw_plugin:"},{"line_number":90,"context_line":"            fw_plugin \u003d DB_FW_PLUGIN_KLASS"},{"line_number":91,"context_line":"        service_plugins \u003d {\u0027fw_plugin_name\u0027: fw_plugin}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F%2F5Bc%3D","line":88,"in_reply_to":"AAAAWH%2F%2F8qY%3D","updated":"2014-03-13 05:44:11.000000000","message":"Done","commit_id":"8e4c03f5ebd48a6fdafcf8e07d9e34443c0e9562"}],"neutron/tests/unit/services/firewall/test_fwaas_plugin.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"7ed7356cc3d2a4d492461d2095af97cb550d74e8","unresolved":false,"context_lines":[{"line_number":299,"context_line":"                    self.assertEqual(fw_db[k], v)"},{"line_number":300,"context_line":"            # cleanup the pending firewall"},{"line_number":301,"context_line":"            self.plugin.callbacks.firewall_deleted(ctx, fw_id)"},{"line_number":302,"context_line":"        self.agentapi_delf_p.start()"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def test_delete_firewall_after_agent_delete(self):"},{"line_number":305,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2FZDg%3D","line":302,"updated":"2014-03-06 12:11:33.000000000","message":"Needed? Won\u0027t it be started as part of next test case setup?","commit_id":"25573b32775c804398a2d1ce1d47b9c7aade5c33"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"99485154d35e234a88412ace73e4d087820685ef","unresolved":false,"context_lines":[{"line_number":299,"context_line":"                    self.assertEqual(fw_db[k], v)"},{"line_number":300,"context_line":"            # cleanup the pending firewall"},{"line_number":301,"context_line":"            self.plugin.callbacks.firewall_deleted(ctx, fw_id)"},{"line_number":302,"context_line":"        self.agentapi_delf_p.start()"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def test_delete_firewall_after_agent_delete(self):"},{"line_number":305,"context_line":"        ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2FVTo%3D","line":302,"in_reply_to":"AAAAVn%2F%2FZDg%3D","updated":"2014-03-06 19:20:45.000000000","message":"You\u0027re right. I was under the impression that setup and teardown was called only once for the entire class of tests.","commit_id":"25573b32775c804398a2d1ce1d47b9c7aade5c33"}]}
