support bucket names in url paths in s3bucket_path

This commit is contained in:
Brock Pytlik 2013-10-28 13:43:25 -07:00 committed by Steve Pulec
commit 5a475881d2
13 changed files with 575 additions and 163 deletions

View file

@ -0,0 +1,14 @@
from sure import expect
from moto.s3bucket_path.utils import bucket_name_from_url
def test_base_url():
expect(bucket_name_from_url('https://s3.amazonaws.com/')).should.equal(None)
def test_localhost_bucket():
expect(bucket_name_from_url('https://localhost:5000/wfoobar/abc')).should.equal("wfoobar")
def test_localhost_without_bucket():
expect(bucket_name_from_url('https://www.localhost:5000')).should.equal(None)