コード例 #1
0
 def test_optimize_negative(self):
     client = Mock()
     client.indices.segments.return_value = shards
     client.cluster.state.return_value = open_index
     client.indices.optimize.side_effect = fake_fail
     client.info.return_value = {"version": {"number": "1.4.4"}}
     self.assertFalse(curator.optimize(client, named_index, max_num_segments=2))
コード例 #2
0
ファイル: test_api_commands.py プロジェクト: servomac/curator
 def test_optimize_negative(self):
     client = Mock()
     client.indices.segments.return_value = shards
     client.cluster.state.return_value = open_index
     client.indices.optimize.side_effect = fake_fail
     client.info.return_value = {'version': {'number': '1.4.4'} }
     self.assertFalse(curator.optimize(client, named_index, max_num_segments=2))
コード例 #3
0
 def test_optimize_positive(self):
     client = Mock()
     client.indices.segments.return_value = shards
     client.cluster.state.return_value = open_index
     client.indices.optimize.return_value = None
     client.info.return_value = {"version": {"number": "1.4.4"}}
     self.assertTrue(curator.optimize(client, named_index, max_num_segments=2))
コード例 #4
0
ファイル: test_api_commands.py プロジェクト: servomac/curator
 def test_optimize_positive(self):
     client = Mock()
     client.indices.segments.return_value = shards
     client.cluster.state.return_value = open_index
     client.indices.optimize.return_value = None
     client.info.return_value = {'version': {'number': '1.4.4'} }
     self.assertTrue(curator.optimize(client, named_index, max_num_segments=2))