Example #1
0
 def test_full_alias_remove_positive(self):
     alias = 'testalias'
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     self.create_index('foo')
     curator.add_to_alias(self.client, 'foo', alias=alias)
     curator.alias(self.client, 'dummy', alias=alias, remove=True)
     self.assertEquals(1, len(self.client.indices.get_alias(name=alias)))
Example #2
0
 def test_full_alias_remove_positive(self):
     alias = 'testalias'
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     self.create_index('foo')
     curator.add_to_alias(self.client, 'foo', alias=alias)
     curator.alias(self.client, 'dummy', alias=alias, remove=True)
     self.assertEquals(1, len(self.client.indices.get_alias(name=alias)))
Example #3
0
 def test_full_alias_add_to_pre_existent_alias(self):
     alias = 'testalias'
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     self.create_index('foo')
     self.assertTrue(curator.alias(self.client, 'foo', alias=alias))
     self.assertEquals(2, len(self.client.indices.get_alias(name=alias)))
Example #4
0
 def test_full_alias_add_to_pre_existent_alias(self):
     alias = 'testalias'
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     self.create_index('foo')
     self.assertTrue(curator.alias(self.client, 'foo', alias=alias))
     self.assertEquals(2, len(self.client.indices.get_alias(name=alias)))
Example #5
0
 def test_full_alias_remove_negative(self):
     alias = 'testalias'
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     self.assertFalse(curator.alias(self.client, 'dummy', alias="ooga", remove=True))
Example #6
0
 def test_full_alias_add_non_existent_index(self):
     alias = 'testalias'
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     self.assertFalse(curator.alias(self.client, 'foo', alias='ooga'))
Example #7
0
 def test_full_alias_remove_negative(self):
     alias = 'testalias'
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     self.assertFalse(
         curator.alias(self.client, 'dummy', alias="ooga", remove=True))
Example #8
0
 def test_full_alias_add_non_existent_index(self):
     alias = 'testalias'
     self.create_index('dummy')
     self.client.indices.put_alias(index='dummy', name=alias)
     self.assertFalse(curator.alias(self.client, 'foo', alias='ooga'))