def test_seal_indices_attribute_exception(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.flush_synced.return_value = synced_fail
     client.indices.flush_synced.side_effect = fake_fail
     client.info.return_value = {'version': {'number': '1.6.0'} }
     self.assertTrue(curator.seal_indices(client, named_index))
 def test_seal_indices_onepass_onefail(self):
     client = Mock()
     client.cluster.state.side_effect = four_oh_one
     client.cat.indices.return_value = cat_open_index
     client.indices.flush_synced.return_value = synced_fails
     client.info.return_value = {"version": {"number": "1.6.0"}}
     self.assertTrue(curator.seal_indices(client, named_index))
Example #3
0
 def test_seal_indices_timeout_error(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.flush_synced.return_value = synced_fail
     client.indices.flush_synced.side_effect = urllib3.exceptions.ReadTimeoutError('foo', 'bar', 'message')
     client.info.return_value = {'version': {'number': '1.6.0'} }
     self.assertFalse(curator.seal_indices(client, named_index))
Example #4
0
 def test_seal_indices_good_version(self):
     client = Mock()
     client.cluster.state.side_effect = four_oh_one
     client.cat.indices.return_value = cat_open_index
     client.indices.flush_synced.return_value = synced_pass
     client.info.return_value = {'version': {'number': '1.6.0'} }
     self.assertTrue(curator.seal_indices(client, named_index))
Example #5
0
 def test_seal_indices_onepass_onefail(self):
     client = Mock()
     client.cluster.state.side_effect = four_oh_one
     client.cat.indices.return_value = cat_open_index
     client.indices.flush_synced.return_value = synced_fails
     client.info.return_value = {'version': {'number': '1.6.0'} }
     self.assertTrue(curator.seal_indices(client, named_index))
Example #6
0
 def test_seal_indices_conflicterror(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.flush_synced.return_value = synced_fail
     client.indices.flush_synced.side_effect = sync_conflict
     client.info.return_value = {'version': {'number': '1.6.0'}}
     self.assertTrue(curator.seal_indices(client, named_index))
Example #7
0
 def test_seal_indices_conflicterror(self):
     client = Mock()
     client.cat.indices.return_value = cat_open_index
     client.indices.flush_synced.return_value = synced_fail
     client.indices.flush_synced.side_effect = sync_conflict
     client.info.return_value = {'version': {'number': '1.6.0'} }
     self.assertTrue(curator.seal_indices(client, named_index))
Example #8
0
 def test_seal_indices_attribute_exception(self):
     client = Mock()
     client.cat.indices.return_value = cat_open_index
     client.indices.flush_synced.return_value = synced_fail
     client.indices.flush_synced.side_effect = fake_fail
     client.info.return_value = {'version': {'number': '1.6.0'}}
     self.assertTrue(curator.seal_indices(client, named_index))
 def test_seal_indices_onepass_onefail(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.flush_synced.return_value = synced_fails
     client.info.return_value = {'version': {'number': '1.6.0'} }
     self.assertTrue(curator.seal_indices(client, named_index))
 def test_seal_indices_bad_version(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.flush_synced.return_value = synced_pass
     client.info.return_value = {"version": {"number": "1.3.4"}}
     self.assertTrue(curator.seal_indices(client, named_index))
Example #11
0
 def test_seal_indices_bad_version(self):
     client = Mock()
     client.cluster.state.return_value = open_index
     client.indices.flush_synced.return_value = synced_pass
     client.info.return_value = {'version': {'number': '1.3.4'} }
     self.assertTrue(curator.seal_indices(client, named_index))
Example #12
0
 def test_seal_indices_good_version(self):
     client = Mock()
     client.cat.indices.return_value = cat_open_index
     client.indices.flush_synced.return_value = synced_pass
     client.info.return_value = {'version': {'number': '1.6.0'}}
     self.assertTrue(curator.seal_indices(client, named_index))