moto/tests/test_s3bucket_path/test_s3bucket_path_utils.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
447 B
Python
Raw Normal View History

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():
2017-02-24 02:37:43 +00:00
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)