def test_ModelComponent_raises_if_model_is_empty_iterable():
    """This occurs when the instance is being initialized.

    This is noted because it differs from some other metaclass validations which will raise an exception at class
    definition time.

    """

    class ConfigComponent(ModelComponent):
        def __init__(self, model):
            pass

        @expose(inputs={"param": Number()}, outputs={"foo": Number()})
        def predict(self, param):
            return param

    with pytest.raises(ValueError, match="must have length >= 1"):
        _ = ConfigComponent([])
This occurs when the instance is being initialized.

    This is noted because it differs from some other metaclass validations which will raise an exception at class
    definition time.

    
tests/core/serve/test_gridbase_validations.py