def test_global_fitting(self):
        """
        Tests that time-averaged mean subtraction transformation behaves
        correctly when `global_fit = False` and when `global_fit = True`.
        """

        series_1 = TimeSeries.from_values(np.ones((3, 2, 1)))
        series_2 = TimeSeries.from_values(2 * np.ones((3, 2, 1)))

        # Local fitting - subtracting mean of each series from itself should return
        # zero-valued series:
        transformed_1, transformed_2 = self.DataTransformerMock(
            global_fit=False
        ).fit_transform([series_1, series_2])
        assert transformed_1 == TimeSeries.from_values(np.zeros((3, 2, 1)))
        assert transformed_2 == TimeSeries.from_values(np.zeros((3, 2, 1)))

        # Global fitting - mean of `series_1` and `series_2` should be `1.5`, so
        # `series_1` values should be transformed to `-0.5` and `series_2` values
        # should be transformed to `1.5`:
        transformed_1, transformed_2 = self.DataTransformerMock(
            global_fit=True
        ).fit_transform([series_1, series_2])
        assert transformed_1 == TimeSeries.from_values(-0.5 * np.ones((3, 2, 1)))
        assert transformed_2 == TimeSeries.from_values(0.5 * np.ones((3, 2, 1)))

        Tests that time-averaged mean subtraction transformation behaves
        correctly when `global_fit = False` and when `global_fit = True`.
        
darts/tests/dataprocessing/transformers/test_fittable_data_transformer.py