Updates a test to show the ltrip use problem

This commit is contained in:
Sylvain Fraïssé 2013-09-24 00:00:52 +02:00
parent 596b435e57
commit 0fd4a5a6f8
2 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ bucket_name_regex = re.compile("(.+).s3.amazonaws.com")
def bucket_name_from_url(url): def bucket_name_from_url(url):
domain = urlparse.urlparse(url).netloc domain = urlparse.urlparse(url).netloc
# If 'www' prefixed, strip it. if domain.startswith('www.'):
domain = domain.replace("www.", "") domain = domain[4:]
if 'amazonaws.com' in domain: if 'amazonaws.com' in domain:
bucket_result = bucket_name_regex.search(domain) bucket_result = bucket_name_regex.search(domain)

View File

@ -7,7 +7,7 @@ def test_base_url():
def test_localhost_bucket(): def test_localhost_bucket():
expect(bucket_name_from_url('https://foobar.localhost:5000/abc')).should.equal("foobar") expect(bucket_name_from_url('https://wfoobar.localhost:5000/abc')).should.equal("wfoobar")
def test_localhost_without_bucket(): def test_localhost_without_bucket():