Updates a test to show the ltrip use problem
This commit is contained in:
parent
596b435e57
commit
0fd4a5a6f8
@ -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)
|
||||||
|
@ -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():
|
||||||
|
Loading…
Reference in New Issue
Block a user