@@ -44,7 +44,7 @@ def test_cluster_policy_definition_present_reuse():
4444 ws , prompts = common ()
4545
4646 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
47- policy_id , _ , _ = policy_installer .create ('ucx' )
47+ policy_id , _ , _ , _ = policy_installer .create ('ucx' )
4848 assert policy_id is not None
4949 ws .cluster_policies .create .assert_not_called ()
5050
@@ -73,7 +73,7 @@ def test_cluster_policy_definition_azure_hms():
7373 )
7474 ]
7575 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
76- policy_id , _ , _ = policy_installer .create ('ucx' )
76+ policy_id , _ , _ , _ = policy_installer .create ('ucx' )
7777 policy_definition_actual = {
7878 "spark_version" : {"type" : "fixed" , "value" : "14.2.x-scala2.12" },
7979 "node_type_id" : {"type" : "fixed" , "value" : "Standard_F4s" },
@@ -114,7 +114,7 @@ def test_cluster_policy_definition_aws_glue():
114114 ]
115115
116116 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
117- policy_id , instance_profile , _ = policy_installer .create ('ucx' )
117+ policy_id , instance_profile , _ , _ = policy_installer .create ('ucx' )
118118 policy_definition_actual = {
119119 "spark_version" : {"type" : "fixed" , "value" : "14.2.x-scala2.12" },
120120 "node_type_id" : {"type" : "fixed" , "value" : "Standard_F4s" },
@@ -155,7 +155,7 @@ def test_cluster_policy_definition_gcp():
155155 ]
156156
157157 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
158- policy_id , instance_profile , _ = policy_installer .create ('ucx' )
158+ policy_id , instance_profile , _ , _ = policy_installer .create ('ucx' )
159159 policy_definition_actual = {
160160 "spark_version" : {"type" : "fixed" , "value" : "14.2.x-scala2.12" },
161161 "node_type_id" : {"type" : "fixed" , "value" : "Standard_F4s" },
@@ -257,7 +257,7 @@ def test_cluster_policy_definition_azure_hms_warehouse():
257257 }
258258 )
259259 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
260- policy_id , _ , _ = policy_installer .create ('ucx' )
260+ policy_id , _ , _ , _ = policy_installer .create ('ucx' )
261261 policy_definition_actual = {
262262 "spark_version" : {"type" : "fixed" , "value" : "14.2.x-scala2.12" },
263263 "node_type_id" : {"type" : "fixed" , "value" : "Standard_F4s" },
@@ -309,7 +309,7 @@ def test_cluster_policy_definition_aws_glue_warehouse():
309309 }
310310 )
311311 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
312- policy_id , instance_profile , _ = policy_installer .create ('ucx' )
312+ policy_id , instance_profile , _ , _ = policy_installer .create ('ucx' )
313313 policy_definition_actual = {
314314 "spark_version" : {"type" : "fixed" , "value" : "14.2.x-scala2.12" },
315315 "node_type_id" : {"type" : "fixed" , "value" : "Standard_F4s" },
@@ -364,7 +364,7 @@ def test_cluster_policy_definition_gcp_hms_warehouse():
364364 }
365365 )
366366 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
367- policy_id , _ , _ = policy_installer .create ('ucx' )
367+ policy_id , _ , _ , _ = policy_installer .create ('ucx' )
368368 policy_definition_actual = {
369369 "spark_version" : {"type" : "fixed" , "value" : "14.2.x-scala2.12" },
370370 "node_type_id" : {"type" : "fixed" , "value" : "Standard_F4s" },
@@ -405,7 +405,7 @@ def test_cluster_policy_definition_empty_config():
405405 ]
406406
407407 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
408- policy_id , _ , _ = policy_installer .create ('ucx' )
408+ policy_id , _ , _ , _ = policy_installer .create ('ucx' )
409409 policy_definition_actual = {
410410 "spark_version" : {"type" : "fixed" , "value" : "14.2.x-scala2.12" },
411411 "node_type_id" : {"type" : "fixed" , "value" : "Standard_F4s" },
@@ -431,7 +431,9 @@ def test_cluster_policy_instance_pool():
431431 ws .config .is_gcp = False
432432
433433 policy_installer = ClusterPolicyInstaller (MockInstallation (), ws , prompts )
434- policy_installer .create ('ucx' )
434+ _ , _ , _ , instance_pool_id = policy_installer .create ('ucx' )
435+
436+ assert instance_pool_id == "instance_pool_1"
435437
436438 policy_expected = {
437439 "spark_version" : {"type" : "fixed" , "value" : "14.2.x-scala2.12" },
@@ -452,7 +454,8 @@ def test_cluster_policy_instance_pool():
452454 "node_type_id" : {"type" : "fixed" , "value" : "Standard_F4s" },
453455 "aws_attributes.availability" : {"type" : "fixed" , "value" : "ON_DEMAND" },
454456 }
455- policy_installer .create ('ucx' )
457+ _ , _ , _ , instance_pool_id = policy_installer .create ('ucx' )
458+ assert instance_pool_id is None
456459 ws .cluster_policies .create .assert_called_with (
457460 name = "Unity Catalog Migration (ucx) ([email protected] )" ,
458461 definition = json .dumps (policy_expected ),
0 commit comments