def METHOD_NAME(make_stubber, make_moderation_labels, error_code):
    rekognition_client = boto3.client('rekognition')
    rekognition_stubber = make_stubber(rekognition_client)
    image = RekognitionImage(TEST_IMAGE, 'test-image', rekognition_client)
    labels = [
        RekognitionModerationLabel(label) for label in make_moderation_labels(3)]
    rekognition_stubber.stub_detect_moderation_labels(
        image.image, labels, error_code=error_code)
    if error_code is None:
        got_labels = image.detect_moderation_labels()
        assert (
            [label.to_dict() for label in labels] ==
            [label.to_dict() for label in got_labels])
    else:
        with pytest.raises(ClientError) as exc_info:
            image.detect_moderation_labels()
        assert exc_info.value.response['Error']['Code'] == error_code