Best Python code snippet using lisa_python
features.py
Source:features.py
...399 iops400 for iops, _ in disk_type_iops401 if iops >= min_iops and iops <= max_iops402 )403 value.data_disk_size = self._get_disk_size_from_iops(404 value.data_disk_iops, disk_type_iops405 )406 elif self.data_disk_size:407 req_disk_size = search_space.count_space_to_int_range(408 self.data_disk_size409 )410 cap_disk_size = search_space.count_space_to_int_range(411 capability.data_disk_size412 )413 min_size = max(req_disk_size.min, cap_disk_size.min)414 max_size = min(req_disk_size.max, cap_disk_size.max)415 value.data_disk_iops = min(416 iops417 for iops, disk_size in disk_type_iops418 if disk_size >= min_size and disk_size <= max_size419 )420 value.data_disk_size = self._get_disk_size_from_iops(421 value.data_disk_iops, disk_type_iops422 )423 else:424 # if req is not specified, query minimum value.425 cap_disk_size = search_space.count_space_to_int_range(426 capability.data_disk_size427 )428 value.data_disk_iops = min(429 iops430 for iops, _ in disk_type_iops431 if iops >= cap_disk_size.min and iops <= cap_disk_size.max432 )433 value.data_disk_size = self._get_disk_size_from_iops(434 value.data_disk_iops, disk_type_iops435 )436 # all caching types are supported, so just take the value from requirement.437 value.data_disk_caching_type = self.data_disk_caching_type438 return value439 def _get_disk_size_from_iops(440 self, data_disk_iops: int, disk_type_iops: List[Tuple[int, int]]441 ) -> int:442 return next(443 disk_size for iops, disk_size in disk_type_iops if iops == data_disk_iops...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!