def test_allocation_good_type_param(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.get_settings.return_value = allocation_out
     client.indices.put_settings.return_value = None
     self.assertTrue(curator.allocation(client, named_index, rule="foo=bar", allocation_type="require"))
     self.assertTrue(curator.allocation(client, named_index, rule="foo=bar", allocation_type="include"))
     self.assertTrue(curator.allocation(client, named_index, rule="foo=bar", allocation_type="exclude"))
Beispiel #2
0
 def test_allocation_good_type_param(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.get_settings.return_value = allocation_out
     client.indices.put_settings.return_value = None
     self.assertTrue(curator.allocation(client, named_index, rule="foo=bar", allocation_type="require"))
     self.assertTrue(curator.allocation(client, named_index, rule="foo=bar", allocation_type="include"))
     self.assertTrue(curator.allocation(client, named_index, rule="foo=bar", allocation_type="exclude"))
Beispiel #3
0
 def test_allocation_negative_exception(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.get_settings.return_value = allocation_out
     client.indices.put_settings.side_effect = fake_fail
     self.assertFalse(
         curator.allocation(client, named_index, rule="foo=bar"))
Beispiel #4
0
 def test_allocation_positive(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.get_settings.return_value = allocation_out
     client.indices.put_settings.return_value = None
     self.assertTrue(curator.allocation(client, named_index,
                                        rule="foo=bar"))
Beispiel #5
0
 def test_allocation_wrong_type_param(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.get_settings.return_value = allocation_out
     client.indices.put_settings.return_value = None
     self.assertFalse(
         curator.allocation(client,
                            named_index,
                            rule="foo=bar",
                            allocation_type="wrong_type"))
Beispiel #6
0
 def test_allocation_negative_exception(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.get_settings.return_value = allocation_out
     client.indices.put_settings.side_effect = fake_fail
     self.assertFalse(curator.allocation(client, named_index, rule="foo=bar"))
Beispiel #7
0
 def test_allocation_positive(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.get_settings.return_value = allocation_out
     client.indices.put_settings.return_value = None
     self.assertTrue(curator.allocation(client, named_index, rule="foo=bar"))
 def test_allocation_wrong_type_param(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.get_settings.return_value = allocation_out
     client.indices.put_settings.return_value = None
     self.assertFalse(curator.allocation(client, named_index, rule="foo=bar", allocation_type="wrong_type"))