@@ -234,11 +234,11 @@ def iris_image(sagemaker_session):
234
234
235
235
236
236
def test_create_model_package (sagemaker_session , boto_session , iris_image ):
237
-
237
+ MODEL_NAME = "iris-classifier-mp"
238
238
# Prepare
239
239
s3_bucket = sagemaker_session .default_bucket ()
240
240
241
- model_name = "my-flower-detection-model"
241
+ model_name = unique_name_from_base ( MODEL_NAME )
242
242
model_description = "This model accepts petal length, petal width, sepal length, sepal width and predicts whether \
243
243
flower is of type setosa, versicolor, or virginica"
244
244
@@ -311,10 +311,10 @@ def test_create_model_package(sagemaker_session, boto_session, iris_image):
311
311
# wait for model execution to complete
312
312
time .sleep (60 * 3 )
313
313
314
- # query for all model packages with the name "my-flower-detection-model"
314
+ # query for all model packages with the name <MODEL_NAME>
315
315
response = sm_client .list_model_packages (
316
316
MaxResults = 10 ,
317
- NameContains = "my-flower-detection-model" ,
317
+ NameContains = MODEL_NAME ,
318
318
SortBy = "CreationTime" ,
319
319
SortOrder = "Descending" ,
320
320
)
@@ -325,7 +325,6 @@ def test_create_model_package(sagemaker_session, boto_session, iris_image):
325
325
# assert that response is non-empty
326
326
assert len (response ["ModelPackageSummaryList" ]) > 0
327
327
328
-
329
328
@pytest .mark .skipif (
330
329
tests .integ .test_region () in tests .integ .NO_MARKET_PLACE_REGIONS ,
331
330
reason = "Marketplace is not available in {}" .format (tests .integ .test_region ()),
0 commit comments