'Verify that pool filtering via the search_pattern works correctly
:param pool_filter: A regular expression to be used for filtering via
pool labels
:param pool_labels: A list of pool labels
:param expected_pool_labels: The labels from \'pool_labels\' that
should be matched by \'pool_filter\''

@ddt.data(('[\\d]+,a', ['1', '2', 'a', 'b'], ['1', '2', 'a']), ('1            ,                3', ['1', '2', '3'], ['1', '3']), ('$,3', ['1', '2', '3'], ['3']), ('[a-zA-Z]+', ['1', 'a', 'B'], ['a', 'B']), ('', ['1', '2'], ['1', '2']))
@ddt.unpack
def test_get_storage_pools(self, pool_filter, pool_labels, expected_pool_labels):

    self.library.configuration.netapp_pool_name_search_pattern = pool_filter
    pools = [{'label': label} for label in pool_labels]
    self.library._client.list_storage_pools = mock.Mock(return_value=pools)
    filtered_pools = self.library._get_storage_pools()
    filtered_pool_labels = [pool['label'] for pool in filtered_pools]
    self.assertEqual(expected_pool_labels, filtered_pool_labels)
