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)))
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)))
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))
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'))
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))