def test_processNonMove_deltaE_zero_excluding(self):
        """Test _processNonMove when deltaE is 0 and excluding."""
        mockLogger = mock.Mock()
        unit = ExcludeRegionState(mockLogger)

        with mock.patch.multiple(
                unit,
                recordRetraction=mock.DEFAULT,
                recoverRetractionIfNeeded=mock.DEFAULT) as mocks:
            unit.excluding = True
            unit.feedRate = 100

            result = unit._processNonMove("G0 E0 F100", 0)  # pylint: disable=protected-access

            mocks["recordRetraction"].assert_not_called()
            mocks["recoverRetractionIfNeeded"].assert_not_called()
            self.assertEqual(result, [], "The result should be an empty list")
    def test_processNonMove_deltaE_positive(self):
        """Test _processNonMove when deltaE > 0."""
        mockLogger = mock.Mock()
        unit = ExcludeRegionState(mockLogger)

        with mock.patch.object(
                unit,
                'recoverRetractionIfNeeded') as mockRecoverRetractionIfNeeded:
            mockRecoverRetractionIfNeeded.return_value = ["returnedCommand"]
            unit.feedRate = 100

            result = unit._processNonMove("G0 E1 F100", 1)  # pylint: disable=protected-access

            mockRecoverRetractionIfNeeded.assert_called_with(
                "G0 E1 F100", True)
            self.assertEqual(
                result, ["returnedCommand"],
                "The result should match the value returned by recoverRetractionIfNeeded"
            )
    def test_processNonMove_deltaE_negative(self):
        """Test _processNonMove when deltaE < 0."""
        mockLogger = mock.Mock()
        unit = ExcludeRegionState(mockLogger)

        with mock.patch.object(unit,
                               'recordRetraction') as mockRecordRetraction:
            mockRecordRetraction.return_value = ["returnedCommand"]
            unit.feedRate = 100

            result = unit._processNonMove(  # pylint: disable=protected-access
                "G0 E-1 F100", -1)

            mockRecordRetraction.assert_called_with(
                RetractionState(originalCommand="G0 E-1 F100",
                                firmwareRetract=False,
                                extrusionAmount=1,
                                feedRate=100))
            self.assertEqual(
                result, ["returnedCommand"],
                "The result should match the value returned by recordRetraction"
            )