def test_parse_region_from_url(): expected = 'us-west-2' for url in ['http://s3-us-west-2.amazonaws.com/bucket', 'http://s3.us-west-2.amazonaws.com/bucket', 'http://bucket.s3-us-west-2.amazonaws.com', 'https://s3-us-west-2.amazonaws.com/bucket', 'https://s3.us-west-2.amazonaws.com/bucket', 'https://bucket.s3-us-west-2.amazonaws.com']: parse_region_from_url(url).should.equal(expected) expected = 'us-east-1' for url in ['http://s3.amazonaws.com/bucket', 'http://bucket.s3.amazonaws.com', 'https://s3.amazonaws.com/bucket', 'https://bucket.s3.amazonaws.com']: parse_region_from_url(url).should.equal(expected)
def test_parse_region_from_url(): expected = 'us-west-2' for url in [ 'http://s3-us-west-2.amazonaws.com/bucket', 'http://s3.us-west-2.amazonaws.com/bucket', 'http://bucket.s3-us-west-2.amazonaws.com', 'https://s3-us-west-2.amazonaws.com/bucket', 'https://s3.us-west-2.amazonaws.com/bucket', 'https://bucket.s3-us-west-2.amazonaws.com' ]: parse_region_from_url(url).should.equal(expected) expected = 'us-east-1' for url in [ 'http://s3.amazonaws.com/bucket', 'http://bucket.s3.amazonaws.com', 'https://s3.amazonaws.com/bucket', 'https://bucket.s3.amazonaws.com' ]: parse_region_from_url(url).should.equal(expected)
def test_parse_region_from_url(): expected = "us-west-2" for url in [ "http://s3-us-west-2.amazonaws.com/bucket", "http://s3.us-west-2.amazonaws.com/bucket", "http://bucket.s3-us-west-2.amazonaws.com", "https://s3-us-west-2.amazonaws.com/bucket", "https://s3.us-west-2.amazonaws.com/bucket", "https://bucket.s3-us-west-2.amazonaws.com", ]: parse_region_from_url(url).should.equal(expected) expected = "us-east-1" for url in [ "http://s3.amazonaws.com/bucket", "http://bucket.s3.amazonaws.com", "https://s3.amazonaws.com/bucket", "https://bucket.s3.amazonaws.com", ]: parse_region_from_url(url).should.equal(expected)