def test_conditional_seasonality(self):
        """
        Test that conditional seasonality is correctly incorporated by the model
        """
        duration = 395
        horizon = 7
        df = pd.DataFrame()
        df["ds"] = pd.date_range(start="2022-01-02", periods=395)
        df["y"] = [i + 10 * (i % 7 == 0) for i in range(duration)]
        df["is_sunday"] = df["ds"].apply(lambda x: int(x.weekday() == 6))

        ts = TimeSeries.from_dataframe(
            df[:-horizon], time_col="ds", value_cols="y", freq="D"
        )
        future_covariates = TimeSeries.from_dataframe(
            df, time_col="ds", value_cols=["is_sunday"], freq="D"
        )
        expected_result = TimeSeries.from_dataframe(
            df[-horizon:], time_col="ds", value_cols="y", freq="D"
        )

        model = Prophet(seasonality_mode="additive")
        model.add_seasonality(
            name="weekly_sun",
            seasonal_periods=7,
            fourier_order=2,
            condition_name="is_sunday",
        )

        model.fit(ts, future_covariates=future_covariates)

        forecast = model.predict(horizon, future_covariates=future_covariates)

        for val_i, pred_i in zip(
            expected_result.univariate_values(), forecast.univariate_values()
        ):
            assert abs(val_i - pred_i) < 0.1

        invalid_future_covariates = future_covariates.with_values(
            np.reshape(np.random.randint(0, 3, duration), (-1, 1, 1)).astype("float")
        )

        with pytest.raises(ValueError):
            model.fit(ts, future_covariates=invalid_future_covariates)

        with pytest.raises(ValueError):
            model.fit(
                ts,
                future_covariates=invalid_future_covariates.drop_columns("is_sunday"),
            )

        Test that conditional seasonality is correctly incorporated by the model
        
darts/tests/models/forecasting/test_prophet.py