示例#1
0
def test_transformer_fails_without_model():
    transformer = Transformer(
        model_name='remote-model',
        sagemaker_session=test_local_mode.LocalNoS3Session(),
        instance_type='local',
        instance_count=1)

    with pytest.raises(ValueError) as error:

        transformer.transform('empty-data')

    assert str(error.value) == 'Failed to fetch model information for remote-model. ' \
                               'Please ensure that the model exists. ' \
                               'Local instance types require locally created models.'
示例#2
0
def test_transformer_fails_without_model():
    transformer = Transformer(
        model_name="remote-model",
        sagemaker_session=test_local_mode.LocalNoS3Session(),
        instance_type="local",
        instance_count=1,
    )

    with pytest.raises(ValueError) as error:

        transformer.transform("empty-data")

    assert (str(
        error.value) == "Failed to fetch model information for remote-model. "
            "Please ensure that the model exists. "
            "Local instance types require locally created models.")