def METHOD_NAME(make_stubber, data, error_code):
    s3_resource = boto3.resource('s3')
    s3_stubber = make_stubber(s3_resource.meta.client)
    bucket_name = 'test-bucket'
    key = 'test-key'
    wrapper = ObjectWrapper(s3_resource.Object(bucket_name, key))
    s3_stubber.stub_put_object(bucket_name, key, error_code=error_code)
    if error_code is None:
        s3_stubber.stub_head_object(bucket_name, key)
    if error_code is None:
        wrapper.put(data)
    else:
        with pytest.raises(ClientError) as exc_info:
            wrapper.put(data)
        assert exc_info.value.response['Error']['Code'] == error_code