Esempio n. 1
0
 def test_positive(self):
     for i in range(1, 11):
         self.create_index('test_index{0}'.format(i))
     self.client.indices.close(index='test_index1,test_index2,test_index3')
     l = curator.get_indices(self.client)
     l = sorted(curator.prune_opened(self.client, l))
     self.assertEqual(3, len(l))
     r = ["test_index1", "test_index2", "test_index3"]
     self.assertEqual(l, r)
Esempio n. 2
0
 def test_negative(self):
     for i in range(1, 11):
         self.create_index('test_index{0}'.format(i))
     self.client.indices.delete(index='test_index1,test_index2,test_index3')
     self.client.indices.close(index='test_index4')
     l = curator.get_indices(self.client)
     l = sorted(curator.prune_opened(self.client, l))
     self.assertEqual(1, len(l))
     r = ["test_index4"]
     self.assertEqual(l, r)
Esempio n. 3
0
 def test_positive(self):
     for i in range(1, 11):
         self.create_index('test_index{0}'.format(i))
     self.client.indices.close(index='test_index1,test_index2,test_index3')
     l = curator.get_indices(self.client)
     l = sorted(curator.prune_closed(self.client, l))
     self.assertEqual(7, len(l))
     r = [
         "test_index10", "test_index4", "test_index5", "test_index6",
         "test_index7", "test_index8", "test_index9",
         ]
     self.assertEqual(l, r)
Esempio n. 4
0
 def test_negative(self):
     for i in range(1, 11):
         self.create_index('test_index{0}'.format(i))
     self.client.indices.delete(index='test_index1,test_index2,test_index3')
     l = curator.get_indices(self.client)
     l = sorted(curator.prune_closed(self.client, l))
     self.assertEqual(7, len(l))
     r = [
         "test_index10",
         "test_index4",
         "test_index5",
         "test_index6",
         "test_index7",
         "test_index8",
         "test_index9",
     ]
     self.assertEqual(l, r)
Esempio n. 5
0
 def test_positive(self):
     self.create_index('test_index1')
     self.create_index('test_index2')
     l = sorted(curator.get_indices(self.client))
     r = ["test_index1", "test_index2"]
     self.assertEqual(r, l)
Esempio n. 6
0
 def test_exception(self):
     client = "foo"
     l = curator.get_indices(client)
     self.assertFalse(l)
Esempio n. 7
0
 def test_negative(self):
     l = sorted(curator.get_indices(self.client))
     r = ["test_index1", "test_index2"]
     self.assertNotEqual(r, l)
Esempio n. 8
0
 def test_positive(self):
     self.create_index('test_index1')
     self.create_index('test_index2')
     l = sorted(curator.get_indices(self.client))
     r = ["test_index1", "test_index2"]
     self.assertEqual(r, l)
Esempio n. 9
0
 def test_exception(self):
     client = "foo"
     l = curator.get_indices(client)
     self.assertFalse(l)
Esempio n. 10
0
 def test_negative(self):
     l = sorted(curator.get_indices(self.client))
     r = ["test_index1", "test_index2"]
     self.assertNotEqual(r, l)