Code Duplication    Length = 12-13 lines in 2 locations

tests/unit/test_main.py 2 locations

@@ 228-240 (lines=13) @@
225
        self.napp.event_flows_install_delete(event)
226
        mock_install_flows.assert_called_with('add', mock_flow_dict, [switch])
227
228
    @patch('napps.kytos.flow_manager.main.Main._install_flows')
229
    def test_event_flows_install_delete(self, mock_install_flows):
230
        """Test method for removing flows on the switches through events."""
231
        dpid = "00:00:00:00:00:00:00:01"
232
        switch = get_switch_mock(dpid)
233
        self.napp.controller.switches = {dpid: switch}
234
        mock_flow_dict = MagicMock()
235
        event = get_kytos_event_mock(name='kytos.flow_manager.flows.delete',
236
                                     content={'dpid': dpid,
237
                                              'flow_dict': mock_flow_dict})
238
        self.napp.event_flows_install_delete(event)
239
        mock_install_flows.assert_called_with('delete', mock_flow_dict,
240
                                              [switch])
241
242
    def test_add_flow_mod_sent(self):
243
        """Test _add_flow_mod_sent method."""
@@ 215-226 (lines=12) @@
212
        mock_send_napp_event.assert_called_with(self.switch_01, flow,
213
                                                'delete_strict')
214
215
    @patch('napps.kytos.flow_manager.main.Main._install_flows')
216
    def test_event_add_flow(self, mock_install_flows):
217
        """Test method for installing flows on the switches through events."""
218
        dpid = "00:00:00:00:00:00:00:01"
219
        switch = get_switch_mock(dpid)
220
        self.napp.controller.switches = {dpid: switch}
221
        mock_flow_dict = MagicMock()
222
        event = get_kytos_event_mock(name='kytos.flow_manager.flows.install',
223
                                     content={'dpid': dpid,
224
                                              'flow_dict': mock_flow_dict})
225
        self.napp.event_flows_install_delete(event)
226
        mock_install_flows.assert_called_with('add', mock_flow_dict, [switch])
227
228
    @patch('napps.kytos.flow_manager.main.Main._install_flows')
229
    def test_event_flows_install_delete(self, mock_install_flows):