Skip to content

Commit c75f315

Browse files
committed
test: adds unit test for djl lmi regions
1 parent fd566bd commit c75f315

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/unit/sagemaker/image_uris/test_djl.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,29 @@ def _test_djl_uris(account, region, version, tag, djl_framework):
4141
region,
4242
)
4343
assert expected == uri
44+
45+
# Expected regions for DJL LMI based on documentation
46+
# https://github.com/aws/deep-learning-containers/blob/master/available_images.md
47+
EXPECTED_DJL_LMI_REGIONS = {
48+
"us-east-1", "us-east-2", "us-west-1", "us-west-2",
49+
"af-south-1", "ap-east-1", "ap-east-2", "ap-south-1", "ap-south-2",
50+
"ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4",
51+
"ap-southeast-5", "ap-southeast-7", "ap-northeast-1", "ap-northeast-2",
52+
"ap-northeast-3", "ca-central-1", "ca-west-1", "eu-central-1",
53+
"eu-central-2", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1",
54+
"eu-south-1", "eu-south-2", "il-central-1", "mx-central-1",
55+
"me-south-1", "me-central-1", "sa-east-1", "cn-north-1", "cn-northwest-1"
56+
}
57+
58+
59+
def test_djl_lmi_config_for_framework_has_all_regions():
60+
"""Test that config_for_framework('djl-lmi') returns all expected regions for each version."""
61+
config = image_uris.config_for_framework("djl-lmi")
62+
63+
# Check that each version has all expected regions
64+
for version, version_config in config["versions"].items():
65+
actual_regions = set(version_config["registries"].keys())
66+
missing_regions = EXPECTED_DJL_LMI_REGIONS - actual_regions
67+
68+
assert not missing_regions, f"Version {version} missing regions: {missing_regions}"
69+

0 commit comments

Comments
 (0)