7070_TENSORFLOW_PATH = os .path .join (DATA_DIR , "tfs/tfs-test-entrypoint-and-dependencies" )
7171_REPACK_OUTPUT_KEY_PREFIX = "code-output"
7272_MODEL_CODE_LOCATION = f"s3://{ _BUCKET } /{ _REPACK_OUTPUT_KEY_PREFIX } "
73+ _MODEL_CODE_LOCATION_TRAILING_SLASH = _MODEL_CODE_LOCATION + "/"
7374
7475
7576@pytest .fixture
@@ -701,7 +702,7 @@ def test_conditional_model_create_and_regis(
701702 entry_point = f"{ DATA_DIR } /{ _SCRIPT_NAME } " ,
702703 role = _ROLE ,
703704 enable_network_isolation = True ,
704- code_location = _MODEL_CODE_LOCATION ,
705+ code_location = _MODEL_CODE_LOCATION_TRAILING_SLASH ,
705706 ),
706707 2 ,
707708 ),
@@ -725,7 +726,7 @@ def test_conditional_model_create_and_regis(
725726 entry_point = f"{ DATA_DIR } /{ _SCRIPT_NAME } " ,
726727 role = _ROLE ,
727728 framework_version = "1.5.0" ,
728- code_location = _MODEL_CODE_LOCATION ,
729+ code_location = _MODEL_CODE_LOCATION_TRAILING_SLASH ,
729730 ),
730731 2 ,
731732 ),
@@ -757,7 +758,7 @@ def test_conditional_model_create_and_regis(
757758 image_uri = _IMAGE_URI ,
758759 entry_point = f"{ DATA_DIR } /{ _SCRIPT_NAME } " ,
759760 role = _ROLE ,
760- code_location = _MODEL_CODE_LOCATION ,
761+ code_location = _MODEL_CODE_LOCATION_TRAILING_SLASH ,
761762 ),
762763 2 ,
763764 ),
@@ -780,7 +781,9 @@ def assert_test_result(steps: list):
780781 assert len (steps ) == expected_step_num
781782 if expected_step_num == 2 :
782783 assert steps [0 ]["Type" ] == "Training"
783- if model .key_prefix == _REPACK_OUTPUT_KEY_PREFIX :
784+ if model .key_prefix is not None and model .key_prefix .startswith (
785+ _REPACK_OUTPUT_KEY_PREFIX
786+ ):
784787 assert steps [0 ]["Arguments" ]["OutputDataConfig" ]["S3OutputPath" ] == (
785788 f"{ _MODEL_CODE_LOCATION } /{ model .name } "
786789 )
0 commit comments