def test_auto_ml_invalid_input_data_format(sagemaker_session):
    auto_ml = AutoML(role=ROLE,
                     target_attribute_name=TARGET_ATTRIBUTE_NAME,
                     sagemaker_session=sagemaker_session)
    inputs = {}

    expected_error_msg = "Cannot format input {}. Expecting one of str or list of strings."
    with pytest.raises(ValueError, message=expected_error_msg.format(inputs)):
        AutoMLJob.start_new(auto_ml, inputs)
    sagemaker_session.auto_ml.assert_not_called()
def test_auto_ml_default_channel_name(sagemaker_session):
    auto_ml = AutoML(
        role=ROLE, target_attribute_name=TARGET_ATTRIBUTE_NAME, sagemaker_session=sagemaker_session
    )
    inputs = DEFAULT_S3_INPUT_DATA
    AutoMLJob.start_new(auto_ml, inputs)
    sagemaker_session.auto_ml.assert_called_once()
    _, args = sagemaker_session.auto_ml.call_args
    assert args["input_config"] == [
        {
            "DataSource": {
                "S3DataSource": {"S3DataType": "S3Prefix", "S3Uri": DEFAULT_S3_INPUT_DATA}
            },
            "TargetAttributeName": TARGET_ATTRIBUTE_NAME,
        }
    ]