Code Duplication    Length = 12-13 lines in 2 locations

tests/unit/test_main.py 2 locations

@@ 203-215 (lines=13) @@
200
        self.napp.event_add_flow(event)
201
        mock_install_flows.assert_called_with('add', mock_flow_dict, [switch])
202
203
    @patch('napps.kytos.flow_manager.main.Main._install_flows')
204
    def test_event_add_flow_delete(self, mock_install_flows):
205
        """Test method for removing flows on the switches through events."""
206
        dpid = "00:00:00:00:00:00:00:01"
207
        switch = get_switch_mock(dpid)
208
        self.napp.controller.switches = {dpid: switch}
209
        mock_flow_dict = MagicMock()
210
        event = get_kytos_event_mock(name='kytos.flow_manager.flows.delete',
211
                                     content={'dpid': dpid,
212
                                              'flow_dict': mock_flow_dict})
213
        self.napp.event_add_flow(event)
214
        mock_install_flows.assert_called_with('delete', mock_flow_dict,
215
                                              [switch])
216
217
    def test_add_flow_mod_sent(self):
218
        """Test _add_flow_mod_sent method."""
@@ 190-201 (lines=12) @@
187
        mock_send_napp_event.assert_called_with(self.switch_01, flow,
188
                                                'delete_strict')
189
190
    @patch('napps.kytos.flow_manager.main.Main._install_flows')
191
    def test_event_add_flow(self, mock_install_flows):
192
        """Test method for installing flows on the switches through events."""
193
        dpid = "00:00:00:00:00:00:00:01"
194
        switch = get_switch_mock(dpid)
195
        self.napp.controller.switches = {dpid: switch}
196
        mock_flow_dict = MagicMock()
197
        event = get_kytos_event_mock(name='kytos.flow_manager.flows.install',
198
                                     content={'dpid': dpid,
199
                                              'flow_dict': mock_flow_dict})
200
        self.napp.event_add_flow(event)
201
        mock_install_flows.assert_called_with('add', mock_flow_dict, [switch])
202
203
    @patch('napps.kytos.flow_manager.main.Main._install_flows')
204
    def test_event_add_flow_delete(self, mock_install_flows):