2014-08-27 15:17:06 +00:00
|
|
|
from __future__ import unicode_literals
|
2013-10-28 20:43:25 +00:00
|
|
|
from sure import expect
|
|
|
|
from moto.s3bucket_path.utils import bucket_name_from_url
|
|
|
|
|
|
|
|
|
|
|
|
def test_base_url():
|
2019-10-31 15:44:26 +00:00
|
|
|
expect(bucket_name_from_url("https://s3.amazonaws.com/")).should.equal(None)
|
2013-10-28 20:43:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_localhost_bucket():
|
2019-10-31 15:44:26 +00:00
|
|
|
expect(bucket_name_from_url("https://localhost:5000/wfoobar/abc")).should.equal(
|
|
|
|
"wfoobar"
|
|
|
|
)
|
2013-10-28 20:43:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_localhost_without_bucket():
|
2019-10-31 15:44:26 +00:00
|
|
|
expect(bucket_name_from_url("https://www.localhost:5000")).should.equal(None)
|