コード例 #1
0
def test_update_url_credentials_not_from_the_same_server():
    "update_url_credentials() Should just use the second URL if the URLS are pointing to different services"

    # Given that I have a URL with authentication info from domain1.com
    url1 = 'http://*****:*****@domain1.com/resource1.html'

    # And another URL without auth info from domain2.com
    url2 = 'http://domain2.com/resource2.html'

    # When I update the second one based on the first one
    final_url = downloader.update_url_credentials(url1, url2)

    # Then I see that the final URL is just a copy of the second URL
    final_url.should.equal(url2)
コード例 #2
0
def test_update_url_credentials_not_from_the_same_server():
    "update_url_credentials() Should just use the second URL if the URLS are pointing to different services"

    # Given that I have a URL with authentication info from domain1.com
    url1 = 'http://*****:*****@domain1.com/resource1.html'

    # And another URL without auth info from domain2.com
    url2 = 'http://domain2.com/resource2.html'

    # When I update the second one based on the first one
    final_url = downloader.update_url_credentials(url1, url2)

    # Then I see that the final URL is just a copy of the second URL
    final_url.should.equal(url2)
コード例 #3
0
def test_update_url_credentials():
    "update_url_credentials() should update URL2 using auth info from URL1"

    # Given that I have a URL with authentication info
    url1 = 'http://*****:*****@domain.com/path/to/resource.html'

    # And another URL without auth info
    url2 = 'http://domain.com/another/path/to/a/cooler/resource.html'

    # When I update the second one based on the first one
    final_url = downloader.update_url_credentials(url1, url2)

    # Then I see that the final URL version is just the second URL with the auth
    # info from the first one
    final_url.should.equal(
        'http://*****:*****@domain.com/another/path/to/a/cooler/resource.html')
コード例 #4
0
def test_update_url_credentials():
    "update_url_credentials() should update URL2 using auth info from URL1"

    # Given that I have a URL with authentication info
    url1 = 'http://*****:*****@domain.com/path/to/resource.html'

    # And another URL without auth info
    url2 = 'http://domain.com/another/path/to/a/cooler/resource.html'

    # When I update the second one based on the first one
    final_url = downloader.update_url_credentials(url1, url2)

    # Then I see that the final URL version is just the second URL with the auth
    # info from the first one
    final_url.should.equal(
        'http://*****:*****@domain.com/another/path/to/a/cooler/resource.html'
    )