Code Duplication    Length = 13-14 lines in 2 locations

tests/unit/test_main.py 2 locations

@@ 691-704 (lines=14) @@
688
        assert intf.id not in self.napp.liveness_manager.interfaces
689
        assert self.napp.liveness_controller.delete_interfaces.call_count == 1
690
691
    def test_on_switch_deleted_not_loaded(self):
692
        """Test on switch deleted not loaded"""
693
        intf_id = "00:00:00:00:00:00:00:01"
694
        switch = MagicMock()
695
        intf = MagicMock()
696
        intf.id = intf_id
697
        switch.interfaces = {intf_id: intf}
698
        self.napp.liveness_manager.interfaces["some_id"] = intf
699
        content = {"switch": switch}
700
        event = KytosEvent(content=content)
701
        self.napp.on_switch_deleted(event)
702
        assert "some_id" in self.napp.liveness_manager.interfaces
703
        assert intf.id not in self.napp.liveness_manager.interfaces
704
        assert not self.napp.liveness_controller.delete_interfaces.call_count
705
@@ 677-689 (lines=13) @@
674
        assert intf.id not in self.napp.liveness_manager.interfaces
675
        assert not self.napp.liveness_controller.delete_interface.call_count
676
677
    def test_on_switch_deleted(self):
678
        """Test on switch deleted"""
679
        intf_id = "00:00:00:00:00:00:00:01"
680
        switch = MagicMock()
681
        intf = MagicMock()
682
        intf.id = intf_id
683
        switch.interfaces = {intf_id: intf}
684
        self.napp.liveness_manager.interfaces[intf_id] = intf
685
        content = {"switch": switch}
686
        event = KytosEvent(content=content)
687
        self.napp.on_switch_deleted(event)
688
        assert intf.id not in self.napp.liveness_manager.interfaces
689
        assert self.napp.liveness_controller.delete_interfaces.call_count == 1
690
691
    def test_on_switch_deleted_not_loaded(self):
692
        """Test on switch deleted not loaded"""