This is an automated email from the ASF dual-hosted git repository. tomaz pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 50f475055733b6d617be1dfd64f45194d24c0cdc Author: Tomaz Muraus <[email protected]> AuthorDate: Fri Dec 13 17:24:10 2019 +0100 Add a test case for host argument having priority over region one. --- libcloud/test/storage/test_s3.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libcloud/test/storage/test_s3.py b/libcloud/test/storage/test_s3.py index 4102483..39af09a 100644 --- a/libcloud/test/storage/test_s3.py +++ b/libcloud/test/storage/test_s3.py @@ -1071,6 +1071,14 @@ class S3Tests(unittest.TestCase): self.assertRaisesRegexp(ValueError, expected_msg, S3StorageDriver, *self.driver_args, region='foo') + # host argument still has precedence over reguin + driver3 = S3StorageDriver(*self.driver_args, region='ap-south-1', host='host1.bar.com') + self.assertEqual(driver3.region, 'ap-south-1') + self.assertEqual(driver3.connection.host, 'host1.bar.com') + + driver4 = S3StorageDriver(*self.driver_args, host='host2.bar.com') + self.assertEqual(driver4.connection.host, 'host2.bar.com') + def test_deprecated_driver_class_per_region(self): driver = S3USWestStorageDriver(*self.driver_args) self.assertEqual(driver.region, 'us-west-1')
