-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct the lookup of the health endpoint to avoid caching when the l…
…ambda is warm.
- Loading branch information
Graham Hargreaves
committed
Oct 8, 2021
1 parent
3a54879
commit a2c2010
Showing
3 changed files
with
38 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
boto3==1.18.57 | ||
pytest==6.2.5 | ||
pytest-mock==3.6.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import handler | ||
import pytest | ||
|
||
|
||
@pytest.mark.parametrize('region', ['us-east-1', 'us-east-2']) | ||
def test_boto3_config_object(region, mocker): | ||
"""When the DNS record changes for the health API the config should be updated correctly""" | ||
mock_gethostname = mocker.patch('handler.socket.gethostbyname_ex') | ||
mock_gethostname.return_value = (f'health.{region}.amazonaws.com', ['global.health.amazonaws.com'], ['52.94.233.29']) | ||
assert handler.create_boto3_config().region_name == region |