2013-10-28 20:43:25 +00:00
|
|
|
from moto.s3bucket_path.utils import bucket_name_from_url
|
|
|
|
|
|
|
|
|
|
|
|
def test_base_url():
|
2023-08-04 21:52:10 +00:00
|
|
|
assert bucket_name_from_url("https://s3.amazonaws.com/") is None
|
2013-10-28 20:43:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_localhost_bucket():
|
2023-08-04 21:52:10 +00:00
|
|
|
assert bucket_name_from_url("https://localhost:5000/wfoobar/abc") == "wfoobar"
|
2013-10-28 20:43:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_localhost_without_bucket():
|
2023-08-04 21:52:10 +00:00
|
|
|
assert bucket_name_from_url("https://www.localhost:5000") is None
|