69
69
_TENSORFLOW_PATH = os .path .join (DATA_DIR , "tfs/tfs-test-entrypoint-and-dependencies" )
70
70
_REPACK_OUTPUT_KEY_PREFIX = "code-output"
71
71
_MODEL_CODE_LOCATION = f"s3://{ _BUCKET } /{ _REPACK_OUTPUT_KEY_PREFIX } "
72
+ _MODEL_CODE_LOCATION_TRAILING_SLASH = _MODEL_CODE_LOCATION + "/"
72
73
73
74
74
75
@pytest .fixture
@@ -690,7 +691,7 @@ def test_conditional_model_create_and_regis(
690
691
entry_point = f"{ DATA_DIR } /{ _SCRIPT_NAME } " ,
691
692
role = _ROLE ,
692
693
enable_network_isolation = True ,
693
- code_location = _MODEL_CODE_LOCATION ,
694
+ code_location = _MODEL_CODE_LOCATION_TRAILING_SLASH ,
694
695
),
695
696
2 ,
696
697
),
@@ -714,7 +715,7 @@ def test_conditional_model_create_and_regis(
714
715
entry_point = f"{ DATA_DIR } /{ _SCRIPT_NAME } " ,
715
716
role = _ROLE ,
716
717
framework_version = "1.5.0" ,
717
- code_location = _MODEL_CODE_LOCATION ,
718
+ code_location = _MODEL_CODE_LOCATION_TRAILING_SLASH ,
718
719
),
719
720
2 ,
720
721
),
@@ -746,7 +747,7 @@ def test_conditional_model_create_and_regis(
746
747
image_uri = _IMAGE_URI ,
747
748
entry_point = f"{ DATA_DIR } /{ _SCRIPT_NAME } " ,
748
749
role = _ROLE ,
749
- code_location = _MODEL_CODE_LOCATION ,
750
+ code_location = _MODEL_CODE_LOCATION_TRAILING_SLASH ,
750
751
),
751
752
2 ,
752
753
),
@@ -769,7 +770,9 @@ def assert_test_result(steps: list):
769
770
assert len (steps ) == expected_step_num
770
771
if expected_step_num == 2 :
771
772
assert steps [0 ]["Type" ] == "Training"
772
- if model .key_prefix == _REPACK_OUTPUT_KEY_PREFIX :
773
+ if model .key_prefix is not None and model .key_prefix .startswith (
774
+ _REPACK_OUTPUT_KEY_PREFIX
775
+ ):
773
776
assert steps [0 ]["Arguments" ]["OutputDataConfig" ]["S3OutputPath" ] == (
774
777
f"{ _MODEL_CODE_LOCATION } /{ model .name } "
775
778
)
0 commit comments