def test_is_local_service_url(self): local_urls = [ 'http://localhost', 'https://localhost', 'http://localhost:4566', 'https://localhost:4566', 'http://localhost.localstack.cloud:4566', 'https://s3.localhost.localstack.cloud', 'http://mybucket.s3.localhost.localstack.cloud:4566', 'https://mybucket.s3.localhost' ] remote_urls = [ 'https://mybucket.s3.amazonaws.com', 'http://mybucket.s3.us-east-1.amazonaws.com' ] for url in local_urls: self.assertTrue(template_preparer.is_local_service_url(url)) for url in remote_urls: self.assertFalse(template_preparer.is_local_service_url(url))
def test_is_local_service_url(): local_urls = [ "http://localhost", "https://localhost", "http://localhost:4566", "https://localhost:4566", "http://localhost.localstack.cloud:4566", "https://s3.localhost.localstack.cloud", "http://mybucket.s3.localhost.localstack.cloud:4566", "https://mybucket.s3.localhost", ] remote_urls = [ "https://mybucket.s3.amazonaws.com", "http://mybucket.s3.us-east-1.amazonaws.com", ] for url in local_urls: assert template_preparer.is_local_service_url(url) for url in remote_urls: assert not template_preparer.is_local_service_url(url)