33
44from datacrunch .exceptions import APIException
55from datacrunch .volumes .volumes import VolumesService , Volume
6- from datacrunch .constants import VolumeStatus , VolumeTypes , VolumeActions , ErrorCodes
6+ from datacrunch .constants import VolumeStatus , VolumeTypes , VolumeActions , ErrorCodes , Locations
77
88INVALID_REQUEST = ErrorCodes .INVALID_REQUEST
99INVALID_REQUEST_MESSAGE = 'Your existence is invalid'
1010
1111INSTANCE_ID = "4fee633c-b119-4447-af9c-70ba17675fc5"
1212
13- FIN1 = "FIN1"
1413NVME = "NVMe"
1514HDD = "HDD"
1615TARGET_VDA = "vda"
3938 "name" : NVME_VOL_NAME ,
4039 "size" : NVME_VOL_SIZE ,
4140 "type" : NVME ,
42- "location_code" : FIN1 ,
41+ "location_code" : Locations . FIN_01 ,
4342 "is_os_volume" : True ,
4443 "created_at" : NVME_VOL_CREATED_AT ,
4544 "target" : TARGET_VDA ,
5352 "name" : HDD_VOL_NAME ,
5453 "size" : HDD_VOL_SIZE ,
5554 "type" : HDD ,
56- "location_code" : FIN1 ,
55+ "location_code" : Locations . FIN_01 ,
5756 "is_os_volume" : False ,
5857 "created_at" : HDD_VOL_CREATED_AT ,
5958 "target" : None ,
@@ -82,7 +81,7 @@ def test_initialize_a_volume(self):
8281 assert volume .name == HDD_VOL_NAME
8382 assert volume .size == HDD_VOL_SIZE
8483 assert volume .type == HDD
85- assert volume .location == FIN1
84+ assert volume .location == Locations . FIN_01
8685 assert volume .is_os_volume == False
8786 assert volume .created_at == HDD_VOL_CREATED_AT
8887 assert volume .target == None
@@ -113,7 +112,7 @@ def test_get_volumes(self, volumes_service, endpoint):
113112 assert volume_nvme .name == NVME_VOL_NAME
114113 assert volume_nvme .size == NVME_VOL_SIZE
115114 assert volume_nvme .type == NVME
116- assert volume_nvme .location == FIN1
115+ assert volume_nvme .location == Locations . FIN_01
117116 assert volume_nvme .is_os_volume
118117 assert volume_nvme .created_at == NVME_VOL_CREATED_AT
119118 assert volume_nvme .target == TARGET_VDA
@@ -125,7 +124,7 @@ def test_get_volumes(self, volumes_service, endpoint):
125124 assert volume_hdd .name == HDD_VOL_NAME
126125 assert volume_hdd .size == HDD_VOL_SIZE
127126 assert volume_hdd .type == HDD
128- assert volume_hdd .location == FIN1
127+ assert volume_hdd .location == Locations . FIN_01
129128 assert volume_hdd .is_os_volume is False
130129 assert volume_hdd .created_at == HDD_VOL_CREATED_AT
131130 assert volume_hdd .target is None
@@ -154,7 +153,7 @@ def test_get_volumes_by_status_successful(self, volumes_service, endpoint):
154153 assert volume_nvme .name == NVME_VOL_NAME
155154 assert volume_nvme .size == NVME_VOL_SIZE
156155 assert volume_nvme .type == NVME
157- assert volume_nvme .location == FIN1
156+ assert volume_nvme .location == Locations . FIN_01
158157 assert volume_nvme .is_os_volume
159158 assert volume_nvme .created_at == NVME_VOL_CREATED_AT
160159 assert volume_nvme .target == TARGET_VDA
@@ -198,7 +197,7 @@ def test_get_volume_by_id_successful(self, volumes_service, endpoint):
198197 assert volume_nvme .name == NVME_VOL_NAME
199198 assert volume_nvme .size == NVME_VOL_SIZE
200199 assert volume_nvme .type == NVME
201- assert volume_nvme .location == FIN1
200+ assert volume_nvme .location == Locations . FIN_01
202201 assert volume_nvme .is_os_volume
203202 assert volume_nvme .created_at == NVME_VOL_CREATED_AT
204203 assert volume_nvme .target == TARGET_VDA
0 commit comments