Conversation
| @unittest.mock.patch("localstack.config.ALLOW_NONSTANDARD_REGIONS", True) | ||
| def test_nonstandard_regions(create_boto_client, monkeypatch): | ||
| """ | ||
| Ensure that non-standard AWS regions can be used vertically. | ||
| """ | ||
| monkeypatch.setenv("MOTO_ALLOW_NONEXISTENT_REGION", "true") |
There was a problem hiding this comment.
Ideally we want to patch the config option before LS starts. What's a proper way to do this?
There was a problem hiding this comment.
unfortunately there is no good way of doing as at all. especially not in a test. config.py seems good for the runtime
987c703 to
d0c26fe
Compare
| ec2_client.create_key_pair(KeyName="foo") | ||
|
|
||
| # Create a resource in LocalStack store | ||
| sqs_client = create_boto_client("sqs", region_name="pluto-central-2a") |
| @unittest.mock.patch("localstack.config.ALLOW_NONSTANDARD_REGIONS", True) | ||
| def test_nonstandard_regions(create_boto_client, monkeypatch): | ||
| """ | ||
| Ensure that non-standard AWS regions can be used vertically. | ||
| """ | ||
| monkeypatch.setenv("MOTO_ALLOW_NONEXISTENT_REGION", "true") |
There was a problem hiding this comment.
unfortunately there is no good way of doing as at all. especially not in a test. config.py seems good for the runtime
|
thanks guys |
| import unittest | ||
|
|
||
|
|
||
| @unittest.mock.patch("localstack.config.ALLOW_NONSTANDARD_REGIONS", True) |
There was a problem hiding this comment.
we usually use monkeypatch.setattr(config, "ALLOW_NONSTANDARD_REGIONS", True) here.
Any reason you're using unittest in this case?
There was a problem hiding this comment.
No particular reason at all, it just didn't cross my mind. I'll fix it when I retouch this next time
Introduces a new config option
ALLOW_NONSTANDARD_REGIONSwhich disables strict validation of AWS regions.Closes #7993