import requests
import logging


def test_upload(url):
    """
    Check if a presigned URL is valid
    """
    try:
        response = requests.put(url, data='aa', timeout=120)
    except:
        return None

    if response.status_code == 403:
        return False

    logging.info('Successfully tested upload url')
    return True