@@ -939,7 +939,7 @@ def test_deploy_full(
939939 assert result == access_token
940940
941941 @patch ("datacustomcode.deploy._retrieve_access_token" )
942- @patch ("datacustomcode.deploy.verify_data_transform_config " )
942+ @patch ("datacustomcode.deploy.get_config " )
943943 @patch ("datacustomcode.deploy.create_deployment" )
944944 @patch ("datacustomcode.deploy.zip" )
945945 @patch ("datacustomcode.deploy.upload_zip" )
@@ -952,21 +952,32 @@ def test_deploy_full_client_credentials(
952952 mock_upload_zip ,
953953 mock_zip ,
954954 mock_create_deployment ,
955- mock_verify_config ,
955+ mock_get_config ,
956956 mock_retrieve_token ,
957957 ):
958958 """Test full deployment process using client credentials auth."""
959+ data_transform_config = DataTransformConfig (
960+ sdkVersion = "1.0.0" ,
961+ entryPoint = "entrypoint.py" ,
962+ dataspace = "test_dataspace" ,
963+ permissions = Permissions (
964+ read = DloPermission (dlo = ["input_dlo" ]),
965+ write = DloPermission (dlo = ["output_dlo" ]),
966+ ),
967+ )
968+ mock_get_config .return_value = data_transform_config
959969 credentials = Credentials (
960970 login_url = "https://example.com" ,
961971 client_id = "id" ,
962972 auth_type = AuthType .CLIENT_CREDENTIALS ,
963973 client_secret = "secret" ,
964974 )
965- metadata = TransformationJobMetadata (
975+ metadata = CodeExtensionMetadata (
966976 name = "test_job" ,
967977 version = "1.0.0" ,
968978 description = "Test job" ,
969979 computeType = "CPU_M" ,
980+ codeType = "script" ,
970981 )
971982 callback = MagicMock ()
972983
@@ -981,13 +992,13 @@ def test_deploy_full_client_credentials(
981992 result = deploy_full ("/test/dir" , metadata , credentials , "default" , callback )
982993
983994 mock_retrieve_token .assert_called_once_with (credentials )
984- mock_verify_config .assert_called_once_with ("/test/dir" )
995+ mock_get_config .assert_called_once_with ("/test/dir" )
985996 mock_create_deployment .assert_called_once_with (access_token , metadata )
986997 mock_zip .assert_called_once_with ("/test/dir" , "default" )
987998 mock_upload_zip .assert_called_once_with ("https://upload.example.com" )
988999 mock_wait .assert_called_once_with (access_token , metadata , callback )
9891000 mock_create_transform .assert_called_once_with (
990- "/test/dir" , access_token , metadata
1001+ "/test/dir" , access_token , metadata , data_transform_config
9911002 )
9921003 assert result == access_token
9931004
0 commit comments