def test_delete_indices_without_predicate(self): self.create_index('test_socorro201801') self.create_index('test_socorro201802') self.create_index('test_socorro_non_week') api = IndexCleaner(self.config) api.delete_indices() # Without a predicate, all week-based indices should be deleted assert not self.index_client.exists('test_socorro201801') assert not self.index_client.exists('test_socorro201802') assert self.index_client.exists('test_socorro_non_week')
def test_delete_indices_without_predicate(self): self.create_index('test_socorro201801') self.create_index('test_socorro201802') self.create_index('test_socorro_non_week') api = IndexCleaner(self.config) api.delete_indices() # Without a predicate, all week-based indices should be deleted assert not self.index_client.exists('test_socorro201801') assert not self.index_client.exists('test_socorro201802') assert self.index_client.exists('test_socorro_non_week')
def test_delete_indices_with_predicate(self): self.create_index('test_socorro201801') self.create_index('test_socorro201802') self.create_index('test_socorro_non_week') api = IndexCleaner(self.config) api.delete_indices(lambda index: index.endswith('2')) # Only week-based indices that match the predicate should be # deleted. assert self.index_client.exists('test_socorro201801') assert not self.index_client.exists('test_socorro201802') assert self.index_client.exists('test_socorro_non_week')
def test_delete_indices_with_predicate(self): self.create_index('test_socorro201801') self.create_index('test_socorro201802') self.create_index('test_socorro_non_week') api = IndexCleaner(self.config) api.delete_indices(lambda index: index.endswith('2')) # Only week-based indices that match the predicate should be # deleted. assert self.index_client.exists('test_socorro201801') assert not self.index_client.exists('test_socorro201802') assert self.index_client.exists('test_socorro_non_week')