def test_validate_pool_names_default(self): all_pools = list('ab') pool_names = utils.validate_pool_names([], all_pools) self.assertEqual(2, len(pool_names)) pool_names = utils.validate_pool_names(None, all_pools) self.assertEqual(2, len(pool_names))
def test_validate_pool_names_filter(self): all_pools = list('acd') pool_names = utils.validate_pool_names(list('abc'), all_pools) self.assertIn('a', pool_names) self.assertIn('c', pool_names) self.assertNotIn('b', pool_names) self.assertNotIn('d', pool_names)
def get_managed_pools(self): names = self.configured_pool_names array_pools = self.client.get_pools() valid_names = utils.validate_pool_names(names, array_pools.name) return {p.name: p for p in array_pools if p.name in valid_names}
def f(): all_pools = list('abc') utils.validate_pool_names(list('efg'), all_pools)