def test_aggregator_predict_wrong_inputs(self, config):
        """Check that exception is raised when predict() arguments are incorrects."""
        aggregator_cls, cls_kwargs, _ = config
        aggregator = aggregator_cls(**cls_kwargs)

        # fit aggregator on series with 2 components
        if isinstance(aggregator, FittableAggregator):
            aggregator.fit(self.real_anomalies, self.mts_anomalies1)

        # predict on (sequence of) univariate series
        with pytest.raises(ValueError):
            aggregator.predict([self.real_anomalies])
        with pytest.raises(ValueError):
            aggregator.predict(self.real_anomalies)
        with pytest.raises(ValueError):
            aggregator.predict([self.mts_anomalies1, self.real_anomalies])

        # input a (sequence of) non binary series
        expected_msg = "Input series `series` must have binary values only."
        with pytest.raises(ValueError) as err:
            aggregator.predict(self.mts_train)
        assert str(err.value) == expected_msg
        with pytest.raises(ValueError) as err:
            aggregator.predict([self.mts_anomalies1, self.mts_train])
        assert str(err.value) == expected_msg

        # input a (sequence of) probabilistic series
        with pytest.raises(ValueError):
            aggregator.predict(self.mts_probabilistic)
        with pytest.raises(ValueError):
            aggregator.predict([self.mts_anomalies1, self.mts_probabilistic])

        # input an element that is not a series
        with pytest.raises(ValueError):
            aggregator.predict([self.mts_anomalies1, "random"])
        with pytest.raises(ValueError):
            aggregator.predict([self.mts_anomalies1, 1])
Check that exception is raised when predict() arguments are incorrects.
darts/tests/ad/test_aggregators.py