Exemple #1
0
def test_request_get_credentials_valid():
    request = Request()
    assert request.get_credentials() is None

    username = "******"
    password = "******"
    request.headers["Authorization"] = "Basic " + "{0}:{1}".format(username, password).encode("base64")

    credentials = request.get_credentials()
    assert credentials.id == username
    assert credentials.secret == password
Exemple #2
0
def test_request_get_credentials_invalid():
    request = Request()
    request.headers["Authorization"] = "Invalid no-data"
    request.get_credentials()