Exemplo n.º 1
0
def test_maybe_add_auth():
    url = "http://www.conda.io:80/some/path.html?query1=1&query2=2"
    new_url = maybe_add_auth(url, "usr:ps")
    assert new_url == "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"

    url = "http://www.conda.io:80/some/path.html?query1=1&query2=2"
    new_url = maybe_add_auth(url, "usr:ps", force=True)
    assert new_url == "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"

    url = "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"
    new_url = maybe_add_auth(url, "usr:ps")
    assert new_url == "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"

    url = "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"
    new_url = maybe_add_auth(url, "usr:ps", force=True)
    assert new_url == "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"
Exemplo n.º 2
0
def test_maybe_add_auth():
    url = "http://www.conda.io:80/some/path.html?query1=1&query2=2"
    new_url = maybe_add_auth(url, "usr:ps")
    assert new_url == "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"

    url = "http://www.conda.io:80/some/path.html?query1=1&query2=2"
    new_url = maybe_add_auth(url, "usr:ps", force=True)
    assert new_url == "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"

    url = "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"
    new_url = maybe_add_auth(url, "usr:ps")
    assert new_url == "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"

    url = "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"
    new_url = maybe_add_auth(url, "usr:ps", force=True)
    assert new_url == "http://*****:*****@www.conda.io:80/some/path.html?query1=1&query2=2"