Skip to content

Commit bd369e6

Browse files
wenhugWen Huang
authored andcommitted
fix: add update_vm_size to profile preview test mocks
The test_update_agentpool_profile_preview tests mock all update methods called by update_agentpool_profile_preview(). Adding update_vm_size() to the call chain requires updating these mocks and assertions. Signed-off-by: wenhug <50309350+wenhug@users.noreply.github.com>
1 parent 1d7b4b6 commit bd369e6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def test_update_agentpool_profile_preview_default_behavior(self):
129129
decorator.update_os_sku = Mock(return_value=agentpool)
130130
decorator.update_fips_image = Mock(return_value=agentpool)
131131
decorator.update_ssh_access = Mock(return_value=agentpool)
132+
decorator.update_vm_size = Mock(return_value=agentpool)
132133
decorator.update_localdns_profile = Mock(return_value=agentpool)
133134
decorator.update_auto_scaler_properties_vms = Mock(return_value=agentpool)
134135
decorator.update_upgrade_strategy = Mock(return_value=agentpool)
@@ -154,6 +155,7 @@ def test_update_agentpool_profile_preview_default_behavior(self):
154155
decorator.update_os_sku.assert_called_once_with(agentpool)
155156
decorator.update_fips_image.assert_called_once_with(agentpool)
156157
decorator.update_ssh_access.assert_called_once_with(agentpool)
158+
decorator.update_vm_size.assert_called_once_with(agentpool)
157159
decorator.update_localdns_profile.assert_called_once_with(agentpool)
158160
decorator.update_auto_scaler_properties_vms.assert_called_once_with(agentpool)
159161
decorator.update_upgrade_strategy.assert_called_once_with(agentpool)
@@ -197,6 +199,7 @@ def test_update_agentpool_profile_preview_with_agentpools_parameter(self):
197199
decorator.update_os_sku = Mock(return_value=agentpool)
198200
decorator.update_fips_image = Mock(return_value=agentpool)
199201
decorator.update_ssh_access = Mock(return_value=agentpool)
202+
decorator.update_vm_size = Mock(return_value=agentpool)
200203
decorator.update_localdns_profile = Mock(return_value=agentpool)
201204
decorator.update_auto_scaler_properties_vms = Mock(return_value=agentpool)
202205
decorator.update_upgrade_strategy = Mock(return_value=agentpool)
@@ -359,6 +362,7 @@ def test_update_agentpool_profile_preview_system_mode_regular_flow(self):
359362
decorator.update_os_sku = Mock(return_value=agentpool)
360363
decorator.update_fips_image = Mock(return_value=agentpool)
361364
decorator.update_ssh_access = Mock(return_value=agentpool)
365+
decorator.update_vm_size = Mock(return_value=agentpool)
362366
decorator.update_localdns_profile = Mock(return_value=agentpool)
363367
decorator.update_auto_scaler_properties_vms = Mock(return_value=agentpool)
364368
decorator.update_upgrade_strategy = Mock(return_value=agentpool)
@@ -382,6 +386,7 @@ def test_update_agentpool_profile_preview_system_mode_regular_flow(self):
382386
decorator.update_os_sku.assert_called_once_with(agentpool)
383387
decorator.update_fips_image.assert_called_once_with(agentpool)
384388
decorator.update_ssh_access.assert_called_once_with(agentpool)
389+
decorator.update_vm_size.assert_called_once_with(agentpool)
385390
decorator.update_localdns_profile.assert_called_once_with(agentpool)
386391
decorator.update_auto_scaler_properties_vms.assert_called_once_with(agentpool)
387392
decorator.update_upgrade_strategy.assert_called_once_with(agentpool)
@@ -430,6 +435,7 @@ def mock_method(pool):
430435
decorator.update_os_sku = create_mock_update_method("update_os_sku")
431436
decorator.update_fips_image = create_mock_update_method("update_fips_image")
432437
decorator.update_ssh_access = create_mock_update_method("update_ssh_access")
438+
decorator.update_vm_size = create_mock_update_method("update_vm_size")
433439
decorator.update_localdns_profile = create_mock_update_method("update_localdns_profile")
434440
decorator.update_auto_scaler_properties_vms = create_mock_update_method("update_auto_scaler_properties_vms")
435441
decorator.update_upgrade_strategy = create_mock_update_method("update_upgrade_strategy")
@@ -450,6 +456,7 @@ def mock_method(pool):
450456
"update_os_sku",
451457
"update_fips_image",
452458
"update_ssh_access",
459+
"update_vm_size",
453460
"update_localdns_profile",
454461
"update_auto_scaler_properties_vms",
455462
"update_upgrade_strategy",
@@ -500,6 +507,7 @@ def track_and_return(pool):
500507
decorator.update_os_sku = create_tracking_mock("update_os_sku")
501508
decorator.update_fips_image = create_tracking_mock("update_fips_image")
502509
decorator.update_ssh_access = create_tracking_mock("update_ssh_access")
510+
decorator.update_vm_size = create_tracking_mock("update_vm_size")
503511
decorator.update_localdns_profile = create_tracking_mock("update_localdns_profile")
504512
decorator.update_auto_scaler_properties_vms = create_tracking_mock("update_auto_scaler_properties_vms")
505513
decorator.update_upgrade_strategy = create_tracking_mock("update_upgrade_strategy")
@@ -567,7 +575,7 @@ def test_update_agentpool_profile_preview_mixed_modes_scenario(self):
567575
update_methods = [
568576
'update_network_profile', 'update_artifact_streaming', 'update_managed_gpu',
569577
'update_secure_boot', 'update_vtpm', 'update_os_sku', 'update_fips_image',
570-
'update_ssh_access', 'update_localdns_profile', 'update_auto_scaler_properties_vms',
578+
'update_ssh_access', 'update_vm_size', 'update_localdns_profile', 'update_auto_scaler_properties_vms',
571579
'update_upgrade_strategy', 'update_blue_green_upgrade_settings', 'update_gpu_profile',
572580
'update_gpu_mig_strategy'
573581
]
@@ -638,6 +646,7 @@ def test_update_agentpool_profile_preview_managed_cluster_mode(self):
638646
decorator.update_os_sku = Mock(return_value=agentpool)
639647
decorator.update_fips_image = Mock(return_value=agentpool)
640648
decorator.update_ssh_access = Mock(return_value=agentpool)
649+
decorator.update_vm_size = Mock(return_value=agentpool)
641650
decorator.update_localdns_profile = Mock(return_value=agentpool)
642651
decorator.update_auto_scaler_properties_vms = Mock(return_value=agentpool)
643652
decorator.update_upgrade_strategy = Mock(return_value=agentpool)

0 commit comments

Comments
 (0)