Skip to content

Commit

Permalink
Fixing the test case
Browse files Browse the repository at this point in the history
  • Loading branch information
mukhoakash committed Jun 28, 2024
1 parent 8d0bf20 commit f84b98c
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -970,49 +970,43 @@ def test_enable_with_ephemeral_disk_nvme_perf_tier_and_ephemeral_temp_disk_pool(
self.assertEqual(str(cm.exception), err)

def test_enable_with_same_ephemeral_disk_nvme_perf_tier_already_set(self):
storage_pool_name = "valid-name"
perf_tier = acstor_consts.CONST_EPHEMERAL_NVME_PERF_TIER_PREMIUM
storage_pool_type = acstor_consts.CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK
storage_pool_option = acstor_consts.CONST_STORAGE_POOL_OPTION_SSD
err = (
"Azure Container Storage is already configured with --ephemeral-disk-nvme-perf-tier "
f"value set to {perf_tier}."
)
with self.assertRaises(InvalidArgumentValueError) as cm:
acstor_validator.validate_enable_azure_container_storage_params(
storage_pool_type, storage_pool_name, None, storage_pool_option, None, None, None, True, False, False, False, True, None, perf_tier, acstor_consts.CONST_DISK_TYPE_PV_WITH_ANNOTATION, acstor_consts.CONST_EPHEMERAL_NVME_PERF_TIER_PREMIUM
storage_pool_type, None, None, None, None, None, None, True, False, False, False, True, None, perf_tier, acstor_consts.CONST_DISK_TYPE_PV_WITH_ANNOTATION, acstor_consts.CONST_EPHEMERAL_NVME_PERF_TIER_PREMIUM
)
self.assertEqual(str(cm.exception), err)

def test_enable_with_same_ephemeral_disk_volume_type_already_set(self):
storage_pool_name = "valid-name"
disk_vol_type = acstor_consts.CONST_DISK_TYPE_PV_WITH_ANNOTATION
storage_pool_type = acstor_consts.CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK
storage_pool_option = acstor_consts.CONST_STORAGE_POOL_OPTION_SSD
err = (
"Azure Container Storage is already configured with --ephemeral-disk-volume-type "
f"value set to {disk_vol_type}."
)
with self.assertRaises(InvalidArgumentValueError) as cm:
acstor_validator.validate_enable_azure_container_storage_params(
storage_pool_type, storage_pool_name, None, storage_pool_option, None, None, None, True, False, False, False, True, disk_vol_type, None, acstor_consts.CONST_DISK_TYPE_PV_WITH_ANNOTATION, acstor_consts.CONST_EPHEMERAL_NVME_PERF_TIER_PREMIUM
storage_pool_type, None, None, None, None, None, None, True, False, False, False, True, disk_vol_type, None, acstor_consts.CONST_DISK_TYPE_PV_WITH_ANNOTATION, acstor_consts.CONST_EPHEMERAL_NVME_PERF_TIER_PREMIUM
)
self.assertEqual(str(cm.exception), err)

def test_enable_with_same_ephemeral_disk_nvme_perf_tier_and_ephemeral_temp_disk_pool_already_set(self):
storage_pool_name = "valid-name"
perf_tier = acstor_consts.CONST_EPHEMERAL_NVME_PERF_TIER_STANDARD
disk_vol_type = acstor_consts.CONST_DISK_TYPE_PV_WITH_ANNOTATION
storage_pool_type = acstor_consts.CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK
storage_pool_option = acstor_consts.CONST_STORAGE_POOL_OPTION_SSD
err = (
"Azure Container Storage is already configured with --ephemeral-disk-volume-type "
f"value set to {disk_vol_type} and --ephemeral-disk-nvme-perf-tier "
f"value set to {perf_tier}."
)
with self.assertRaises(InvalidArgumentValueError) as cm:
acstor_validator.validate_enable_azure_container_storage_params(
storage_pool_type, storage_pool_name, None, storage_pool_option, None, None, None, True, False, False, False, True, disk_vol_type, perf_tier, acstor_consts.CONST_DISK_TYPE_PV_WITH_ANNOTATION, acstor_consts.CONST_EPHEMERAL_NVME_PERF_TIER_STANDARD
storage_pool_type, None, None, None, None, None, None, True, False, False, False, True, disk_vol_type, perf_tier, acstor_consts.CONST_DISK_TYPE_PV_WITH_ANNOTATION, acstor_consts.CONST_EPHEMERAL_NVME_PERF_TIER_STANDARD
)
self.assertEqual(str(cm.exception), err)

Expand Down

0 comments on commit f84b98c

Please sign in to comment.