def _get_tier_opt(tier): ret = [] if tier is not None: possible_tiers = VNXTieringEnum.get_all() if tier in possible_tiers: ret += VNXTieringEnum.get_opt(tier) else: raise ValueError('not supported tiering type: {}. ' 'valid candidates: {}' .format(tier, possible_tiers)) return ret
def _get_tier_opt(tier): ret = [] if tier is not None: possible_tiers = VNXTieringEnum.get_all() if tier in possible_tiers: ret += VNXTieringEnum.get_opt(tier) else: raise ValueError('not supported tiering type: {}. ' 'valid candidates: {}'.format( tier, possible_tiers)) return ret
def test_get_opt(self): opt = VNXTieringEnum.get_opt(VNXTieringEnum.HIGH_AUTO) self.assertEqual( '-initialTier highestAvailable -tieringPolicy autoTier', ' '.join(opt))
def f(): VNXTieringEnum.get_opt('na')
def test_get_opt(self): opt = VNXTieringEnum.get_opt(VNXTieringEnum.HIGH_AUTO) assert_that( ' '.join(opt), equal_to('-initialTier highestAvailable -tieringPolicy autoTier'))