Skip to content

Commit 767d62b

Browse files
committed
Update mock
1 parent 39f0118 commit 767d62b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/aks-preview/azext_aks_preview/agentpool_decorator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def get_update_enable_disable_cluster_autoscaler_and_min_max_count_vmsize_vms(
957957
if not update_cluster_autoscaler and vm_size is not None:
958958
raise MutuallyExclusiveArgumentError(
959959
"--node-vm-size is only applicable when updating cluster autoscaler settings "
960-
"with --updata-cluster-autoscaler"
960+
"with --update-cluster-autoscaler"
961961
)
962962

963963
self._AKSAgentPoolContext__validate_counts_in_autoscaler(

src/aks-preview/azext_aks_preview/tests/latest/test_update_agentpool_profile_preview.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def test_update_agentpool_profile_preview_default_behavior(self):
130130
decorator.update_fips_image = Mock(return_value=agentpool)
131131
decorator.update_ssh_access = Mock(return_value=agentpool)
132132
decorator.update_localdns_profile = Mock(return_value=agentpool)
133+
decorator.update_auto_scaler_properties_vms = Mock(return_value=agentpool)
133134

134135
# Act
135136
result = decorator.update_agentpool_profile_preview()
@@ -150,6 +151,7 @@ def test_update_agentpool_profile_preview_default_behavior(self):
150151
decorator.update_fips_image.assert_called_once_with(agentpool)
151152
decorator.update_ssh_access.assert_called_once_with(agentpool)
152153
decorator.update_localdns_profile.assert_called_once_with(agentpool)
154+
decorator.update_auto_scaler_properties_vms.assert_called_once_with(agentpool)
153155

154156
def test_update_agentpool_profile_preview_with_agentpools_parameter(self):
155157
"""Test update_agentpool_profile_preview with agentpools parameter."""
@@ -188,6 +190,7 @@ def test_update_agentpool_profile_preview_with_agentpools_parameter(self):
188190
decorator.update_fips_image = Mock(return_value=agentpool)
189191
decorator.update_ssh_access = Mock(return_value=agentpool)
190192
decorator.update_localdns_profile = Mock(return_value=agentpool)
193+
decorator.update_auto_scaler_properties_vms = Mock(return_value=agentpool)
191194

192195
# Act
193196
result = decorator.update_agentpool_profile_preview(agentpools)
@@ -237,6 +240,7 @@ def test_update_agentpool_profile_preview_managed_system_mode(self):
237240
decorator.update_fips_image = Mock()
238241
decorator.update_ssh_access = Mock()
239242
decorator.update_localdns_profile = Mock()
243+
decorator.update_auto_scaler_properties_vms = Mock()
240244

241245
# Act
242246
result = decorator.update_agentpool_profile_preview()
@@ -339,6 +343,7 @@ def test_update_agentpool_profile_preview_system_mode_regular_flow(self):
339343
decorator.update_fips_image = Mock(return_value=agentpool)
340344
decorator.update_ssh_access = Mock(return_value=agentpool)
341345
decorator.update_localdns_profile = Mock(return_value=agentpool)
346+
decorator.update_auto_scaler_properties_vms = Mock(return_value=agentpool)
342347

343348
# Act
344349
result = decorator.update_agentpool_profile_preview()
@@ -357,6 +362,7 @@ def test_update_agentpool_profile_preview_system_mode_regular_flow(self):
357362
decorator.update_fips_image.assert_called_once_with(agentpool)
358363
decorator.update_ssh_access.assert_called_once_with(agentpool)
359364
decorator.update_localdns_profile.assert_called_once_with(agentpool)
365+
decorator.update_auto_scaler_properties_vms.assert_called_once_with(agentpool)
360366

361367
def test_update_agentpool_profile_preview_execution_order(self):
362368
"""Test that update methods are called in the correct order."""
@@ -400,6 +406,7 @@ def mock_method(pool):
400406
decorator.update_fips_image = create_mock_update_method("update_fips_image")
401407
decorator.update_ssh_access = create_mock_update_method("update_ssh_access")
402408
decorator.update_localdns_profile = create_mock_update_method("update_localdns_profile")
409+
decorator.update_auto_scaler_properties_vms = create_mock_update_method("update_auto_scaler_properties_vms")
403410

404411
# Act
405412
decorator.update_agentpool_profile_preview()
@@ -414,7 +421,8 @@ def mock_method(pool):
414421
"update_os_sku",
415422
"update_fips_image",
416423
"update_ssh_access",
417-
"update_localdns_profile"
424+
"update_localdns_profile",
425+
"update_auto_scaler_properties_vms"
418426
]
419427
self.assertEqual(call_order, expected_order)
420428

@@ -460,6 +468,7 @@ def track_and_return(pool):
460468
decorator.update_fips_image = create_tracking_mock("update_fips_image")
461469
decorator.update_ssh_access = create_tracking_mock("update_ssh_access")
462470
decorator.update_localdns_profile = create_tracking_mock("update_localdns_profile")
471+
decorator.update_auto_scaler_properties_vms = create_tracking_mock("update_auto_scaler_properties_vms")
463472

464473
# Act
465474
result = decorator.update_agentpool_profile_preview()
@@ -591,6 +600,7 @@ def test_update_agentpool_profile_preview_managed_cluster_mode(self):
591600
decorator.update_fips_image = Mock(return_value=agentpool)
592601
decorator.update_ssh_access = Mock(return_value=agentpool)
593602
decorator.update_localdns_profile = Mock(return_value=agentpool)
603+
decorator.update_auto_scaler_properties_vms = Mock(return_value=agentpool)
594604

595605
# Act
596606
result = decorator.update_agentpool_profile_preview(agentpools)

0 commit comments

Comments
 (0)