コード例 #1
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"))
コード例 #2
0
ファイル: test_api_commands.py プロジェクト: servomac/curator
 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"))
コード例 #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"))
コード例 #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"))
コード例 #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"))
コード例 #6
0
ファイル: test_api_commands.py プロジェクト: ferki/curator
 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"))
コード例 #7
0
ファイル: test_api_commands.py プロジェクト: ferki/curator
 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"))
コード例 #8
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"))