def normalize_config(self, config): config.unity_storage_pool_names = utils.remove_empty( '%s.unity_storage_pool_names' % config.config_group, config.unity_storage_pool_names) config.unity_io_ports = utils.remove_empty( '%s.unity_io_ports' % config.config_group, config.unity_io_ports) return config
def normalize_config(self, config): config.unity_storage_pool_names = utils.remove_empty( '%s.unity_storage_pool_names' % config.config_group, config.unity_storage_pool_names) config.unity_io_ports = utils.remove_empty( '%s.unity_io_ports' % config.config_group, config.unity_io_ports) return config
def test_remove_empty_empty_list(self): option = mock.Mock() value_list = [] ret = utils.remove_empty(option, value_list) expected = None self.assertEqual(expected, ret)
def test_remove_empty(self): option = mock.Mock() value_list = [' pool1', 'pool2 ', ' pool3 '] ret = utils.remove_empty(option, value_list) expected = ['pool1', 'pool2', 'pool3'] self.assertListEqual(expected, ret)
def test_remove_empty_empty_list(self): option = mock.Mock() value_list = [] ret = utils.remove_empty(option, value_list) expected = None self.assertEqual(expected, ret)
def test_remove_empty(self): option = mock.Mock() value_list = [' pool1', 'pool2 ', ' pool3 '] ret = utils.remove_empty(option, value_list) expected = ['pool1', 'pool2', 'pool3'] self.assertListEqual(expected, ret)