1212# language governing permissions and limitations under the License.
1313from __future__ import absolute_import
1414
15+ import pytest
1516from sagemaker import image_uris
1617from tests .unit .sagemaker .image_uris import expected_uris
1718
18- DATA_WRANGLER_ACCOUNTS = {
19- "af-south-1" : "143210264188" ,
20- "ap-east-1" : "707077482487" ,
21- "ap-northeast-1" : "649008135260" ,
22- "ap-northeast-2" : "131546521161" ,
23- "ap-northeast-3" : "913387583493" ,
24- "ap-south-1" : "089933028263" ,
25- "ap-southeast-1" : "119527597002" ,
26- "ap-southeast-2" : "422173101802" ,
27- "ca-central-1" : "557239378090" ,
28- "eu-central-1" : "024640144536" ,
29- "eu-north-1" : "054986407534" ,
30- "eu-south-1" : "488287956546" ,
31- "eu-west-1" : "245179582081" ,
32- "eu-west-2" : "894491911112" ,
33- "eu-west-3" : "807237891255" ,
34- "me-south-1" : "376037874950" ,
35- "sa-east-1" : "424196993095" ,
36- "us-east-1" : "663277389841" ,
37- "us-east-2" : "415577184552" ,
38- "us-west-1" : "926135532090" ,
39- "us-west-2" : "174368400705" ,
40- "cn-north-1" : "245909111842" ,
41- "cn-northwest-1" : "249157047649" ,
42- }
43-
44- # Accounts only supported in DW 3.x and beyond
45- DATA_WRANGLER_3X_ACCOUNTS = {
46- "il-central-1" : "406833011540" ,
47- }
48-
49- VERSIONS = ["1.x" , "2.x" , "3.x" ]
50-
5119
5220def _test_ecr_uri (account , region , version ):
5321 actual_uri = image_uris .retrieve ("data-wrangler" , region = region , version = version )
@@ -60,23 +28,23 @@ def _test_ecr_uri(account, region, version):
6028 return expected_uri == actual_uri
6129
6230
63- def test_data_wrangler_ecr_uri ():
31+ @pytest .mark .parametrize ("load_config" , ["data-wrangler.json" ], indirect = True )
32+ @pytest .mark .parametrize ("extract_versions_for_image_scope" , ["processing" ], indirect = True )
33+ def test_data_wrangler_ecr_uri (load_config , extract_versions_for_image_scope ):
34+ VERSIONS = extract_versions_for_image_scope
6435 for version in VERSIONS :
36+ DATA_WRANGLER_ACCOUNTS = load_config ["processing" ]["versions" ][version ]["registries" ]
6537 for region in DATA_WRANGLER_ACCOUNTS .keys ():
6638 assert _test_ecr_uri (
6739 account = DATA_WRANGLER_ACCOUNTS [region ], region = region , version = version
6840 )
6941
7042
71- def test_data_wrangler_ecr_uri_3x ():
72- for region in DATA_WRANGLER_3X_ACCOUNTS .keys ():
73- assert _test_ecr_uri (
74- account = DATA_WRANGLER_3X_ACCOUNTS [region ], region = region , version = "3.x"
75- )
76-
77-
78- def test_data_wrangler_ecr_uri_none ():
43+ @pytest .mark .parametrize ("load_config" , ["data-wrangler.json" ], indirect = True )
44+ def test_data_wrangler_ecr_uri_none (load_config ):
7945 region = "us-west-2"
46+ VERSIONS = ["1.x" , "2.x" , "3.x" ]
47+ DATA_WRANGLER_ACCOUNTS = load_config ["processing" ]["versions" ]["1.x" ]["registries" ]
8048 actual_uri = image_uris .retrieve ("data-wrangler" , region = region )
8149 expected_uri = expected_uris .algo_uri (
8250 "sagemaker-data-wrangler-container" ,
0 commit comments