desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'Test if status fetch fails with CommandExecutionError'
def test_info_failure(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def info(self): '\n Mock of info method\n ...
'Test if node status fetch succeeds'
def test_node_info(self):
class MockElasticNodes(object, ): '\n Mock of Elasticsearch NodesClient\n ' def info(self, node_id=None, flat_settings=None): '\n ...
'Test if node status fetch fails with CommandExecutionError'
def test_node_info_failure(self):
class MockElasticNodes(object, ): '\n Mock of Elasticsearch NodesClient\n ' def info(self, node_id=None, flat_settings=None): '\n ...
'Test if cluster status health fetch succeeds'
def test_cluster_health(self):
class MockElasticCluster(object, ): '\n Mock of Elasticsearch ClusterClient\n ' def health(self, index=None, level=None, local=None): '\n ...
'Test if cluster status health fetch fails with CommandExecutionError'
def test_cluster_health_failure(self):
class MockElasticCluster(object, ): '\n Mock of Elasticsearch ClusterClient\n ' def health(self, index=None, level=None, local=None): '\n ...
'Test if cluster stats fetch succeeds'
def test_cluster_stats(self):
class MockElasticCluster(object, ): '\n Mock of Elasticsearch ClusterClient\n ' def stats(self, node_id=None): '\n Mock ...
'Test if cluster stats fetch fails with CommandExecutionError'
def test_cluster_stats_failure(self):
class MockElasticCluster(object, ): '\n Mock of Elasticsearch ClusterClient\n ' def stats(self, node_id=None): '\n Mock ...
'Test if alias is created'
def test_alias_create(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_alias(self, index=None, name=None, body=None): '\n ...
'Test if alias creation is not acked'
def test_alias_create_unack(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_alias(self, index=None, name=None, body=None): '\n ...
'Test if alias creation fails with CommandExecutionError'
def test_alias_create_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_alias(self, index=None, name=None, body=None): '\n ...
'Test if alias is deleted'
def test_alias_delete(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_alias(self, index=None, name=None): '\n ...
'Test if alias deletion is not acked'
def test_alias_delete_unack(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_alias(self, index=None, name=None): '\n ...
'Test if alias deletion fails with CommandExecutionError'
def test_alias_delete_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_alias(self, index=None, name=None): '\n ...
'Test if alias exists'
def test_alias_exists(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists_alias(self, index=None, name=None): '\n ...
'Test if alias doesn\'t exist'
def test_alias_exists_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists_alias(self, index=None, name=None): '\n ...
'Test if alias status obtain fails with CommandExecutionError'
def test_alias_exists_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists_alias(self, index=None, name=None): '\n ...
'Test if alias can be obtained'
def test_alias_get(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_alias(self, index=None, name=None): '\n ...
'Test if alias doesn\'t exist'
def test_alias_get_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_alias(self, index=None, name=None): '\n ...
'Test if alias obtain fails with CommandExecutionError'
def test_alias_get_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_alias(self, index=None, name=None): '\n ...
'Test if document can be created'
def test_document_create(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def index(self, index=None, doc_type=None, body=None, id=None): '\n ...
'Test if document creation fails with CommandExecutionError'
def test_document_create_failure(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def index(self, index=None, doc_type=None, body=None, id=None): '\n ...
'Test if document can be deleted'
def test_document_delete(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def delete(self, index=None, doc_type=None, id=None): '\n ...
'Test if document deletion fails with CommandExecutionError'
def test_document_delete_failure(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def delete(self, index=None, doc_type=None, id=None): '\n ...
'Test if document status can be obtained'
def test_document_exists(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def exists(self, index=None, doc_type=None, id=None): '\n ...
'Test if document doesn\'t exist'
def test_document_exists_not(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def exists(self, index=None, doc_type=None, id=None): '\n ...
'Test if document exist state fails with CommandExecutionError'
def test_document_exists_failure(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def exists(self, index=None, doc_type=None, id=None): '\n ...
'Test if document exists'
def test_document_get(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def get(self, index=None, doc_type=None, id=None): '\n M...
'Test if document doesn\'t exit'
def test_document_get_not(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def get(self, index=None, doc_type=None, id=None): '\n M...
'Test if document obtain fails with CommandExecutionError'
def test_document_get_failure(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def get(self, index=None, doc_type=None, id=None): '\n M...
'Test if index can be created'
def test_index_create(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def create(self, index=None, body=None): '\n ...
'Test if index is created and no shards info is returned'
def test_index_create_no_shards(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def create(self, index=None, body=None): '\n ...
'Test if index is created and shards didn\'t acked'
def test_index_create_not_shards(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def create(self, index=None, body=None): '\n ...
'Test if index is created and shards didn\'t acked'
def test_index_create_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def create(self, index=None, body=None): '\n ...
'Test if index creation fails with CommandExecutionError'
def test_index_create_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def create(self, index=None, body=None): '\n ...
'Test if index can be deleted'
def test_index_delete(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete(self, index=None): '\n Mock ...
'Test if index is deleted and shards didn\'t acked'
def test_index_delete_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete(self, index=None): '\n Mock ...
'Test if index deletion fails with CommandExecutionError'
def test_index_delete_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete(self, index=None): '\n Mock ...
'Test if index exists'
def test_index_exists(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists(self, index=None): '\n Mock ...
'Test if index doesn\'t exist'
def test_index_exists_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists(self, index=None): '\n Mock ...
'Test if alias exist state fails with CommandExecutionError'
def test_index_exists_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists(self, index=None): '\n Mock ...
'Test if index can be obtained'
def test_index_get(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get(self, index=None): '\n Mock of ...
'Test if index doesn\'t exist'
def test_index_get_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get(self, index=None): '\n Mock of ...
'Test if index obtain fails with CommandExecutionError'
def test_index_get_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get(self, index=None): '\n Mock of ...
'Test if index can be opened'
def test_index_open(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def open(self, index=None, allow_no_indices=None, expand_wildcards=None, ignore_unavailable=None): '\n ...
'Test if index open isn\'t acked'
def test_index_open_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def open(self, index=None, allow_no_indices=None, expand_wildcards=None, ignore_unavailable=None): '\n ...
'Test if alias opening fails with CommandExecutionError'
def test_index_open_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def open(self, index=None, allow_no_indices=None, expand_wildcards=None, ignore_unavailable=None): '\n ...
'Test if index can be closed'
def test_index_close(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def close(self, index=None, allow_no_indices=None, expand_wildcards=None, ignore_unavailable=None): '\n ...
'Test if index close isn\'t acked'
def test_index_close_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def close(self, index=None, allow_no_indices=None, expand_wildcards=None, ignore_unavailable=None): '\n ...
'Test if index closing fails with CommandExecutionError'
def test_index_close_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def close(self, index=None, allow_no_indices=None, expand_wildcards=None, ignore_unavailable=None): '\n ...
'Test if mapping can be created'
def test_mapping_create(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_mapping(self, index=None, doc_type=None, body=None): '\n ...
'Test if mapping creation didn\'t ack'
def test_mapping_create_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_mapping(self, index=None, doc_type=None, body=None): '\n ...
'Test if mapping creation fails'
def test_mapping_create_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_mapping(self, index=None, doc_type=None, body=None): '\n ...
'Test if mapping can be created'
def test_mapping_delete(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_mapping(self, index=None, doc_type=None): '\n ...
'Test if mapping creation didn\'t ack'
def test_mapping_delete_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_mapping(self, index=None, doc_type=None): '\n ...
'Test if mapping creation fails'
def test_mapping_delete_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_mapping(self, index=None, doc_type=None): '\n ...
'Test if mapping can be created'
def test_mapping_get(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_mapping(self, index=None, doc_type=None): '\n ...
'Test if mapping creation didn\'t ack'
def test_mapping_get_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_mapping(self, index=None, doc_type=None): '\n ...
'Test if mapping creation fails'
def test_mapping_get_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_mapping(self, index=None, doc_type=None): '\n ...
'Test if mapping can be created'
def test_index_template_create(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_template(self, name=None, body=None): '\n ...
'Test if mapping creation didn\'t ack'
def test_index_template_create_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_template(self, name=None, body=None): '\n ...
'Test if mapping creation fails'
def test_index_template_create_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_template(self, name=None, body=None): '\n ...
'Test if mapping can be created'
def test_index_template_delete(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_template(self, name=None): '\n ...
'Test if mapping creation didn\'t ack'
def test_index_template_delete_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_template(self, name=None): '\n ...
'Test if mapping creation fails'
def test_index_template_delete_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_template(self, name=None): '\n ...
'Test if mapping can be created'
def test_index_template_exists(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists_template(self, name=None): '\n ...
'Test if mapping creation didn\'t ack'
def test_index_template_exists_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists_template(self, name=None): '\n ...
'Test if mapping creation fails'
def test_index_template_exists_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def exists_template(self, name=None): '\n ...
'Test if mapping can be created'
def test_index_template_get(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_template(self, name=None): '\n Moc...
'Test if mapping creation didn\'t ack'
def test_index_template_get_not(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_template(self, name=None): '\n Moc...
'Test if mapping creation fails'
def test_index_template_get_failure(self):
class MockElasticIndices(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_template(self, name=None): '\n Moc...
'Test if mapping can be created'
def test_pipeline_get(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_pipeline(self, id=None): '\n Mock ...
'Test if mapping creation didn\'t ack'
def test_pipeline_get_not(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_pipeline(self, id=None): '\n Mock ...
'Test if mapping creation fails'
def test_pipeline_get_failure(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def get_pipeline(self, id=None): '\n Mock ...
'Test if mapping creation fails with CEE on invalid elasticsearch-py version'
def test_pipeline_get_wrong_version(self):
class MockElasticIngest(object, ): pass class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' ingest = MockElasticIngest() with patch.object(elasticsearch, '_get_instanc...
'Test if mapping can be created'
def test_pipeline_delete(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_pipeline(self, id=None): '\n Moc...
'Test if mapping creation didn\'t ack'
def test_pipeline_delete_not(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_pipeline(self, id=None): '\n Moc...
'Test if mapping creation fails'
def test_pipeline_delete_failure(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def delete_pipeline(self, id=None): '\n Moc...
'Test if mapping creation fails with CEE on invalid elasticsearch-py version'
def test_pipeline_delete_wrong_version(self):
class MockElasticIngest(object, ): pass class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' ingest = MockElasticIngest() with patch.object(elasticsearch, '_get_instanc...
'Test if mapping can be created'
def test_pipeline_create(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_pipeline(self, id=None, body=None): '\n ...
'Test if mapping creation didn\'t ack'
def test_pipeline_create_not(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_pipeline(self, id=None, body=None): '\n ...
'Test if mapping creation fails'
def test_pipeline_create_failure(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def put_pipeline(self, id=None, body=None): '\n ...
'Test if mapping creation fails with CEE on invalid elasticsearch-py version'
def test_pipeline_create_wrong_version(self):
class MockElasticIngest(object, ): pass class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' ingest = MockElasticIngest() with patch.object(elasticsearch, '_get_instanc...
'Test if mapping can be created'
def test_pipeline_simulate(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def simulate(self, id=None, body=None, verbose=None): '\n ...
'Test if mapping creation fails'
def test_pipeline_simulate_failure(self):
class MockElasticIngest(object, ): '\n Mock of Elasticsearch IndicesClient\n ' def simulate(self, id=None, body=None, verbose=None): '\n ...
'Test if mapping creation fails with CEE on invalid elasticsearch-py version'
def test_pipeline_simulate_wrong_version(self):
class MockElasticIngest(object, ): pass class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' ingest = MockElasticIngest() with patch.object(elasticsearch, '_get_instanc...
'Test if mapping can be created'
def test_search_template_get(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def get_template(self, id=None): '\n Mock of get_t...
'Test if mapping can be created'
def test_search_template_get_not(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def get_template(self, id=None): '\n Mock of get_t...
'Test if mapping creation fails'
def test_search_template_get_failure(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def get_template(self, id=None): '\n Mock of get_t...
'Test if mapping can be created'
def test_search_template_create(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def put_template(self, id=None, body=None): '\n Mock ...
'Test if mapping can be created'
def test_search_template_create_not(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def put_template(self, id=None, body=None): '\n Mock ...
'Test if mapping creation fails'
def test_search_template_create_failure(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def put_template(self, id=None, body=None): '\n Mock ...
'Test if mapping can be deleted'
def test_search_template_delete(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def delete_template(self, id=None): '\n Mock of de...
'Test if mapping can be deleted but not acked'
def test_search_template_delete_not(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def delete_template(self, id=None): '\n Mock of de...
'Test if deleting mapping doesn\'t exist'
def test_search_template_delete_not_exists(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def delete_template(self, id=None): '\n Mock of de...
'Test if mapping deletion fails'
def test_search_template_delete_failure(self):
class MockElastic(object, ): '\n Mock of Elasticsearch client\n ' def delete_template(self, id=None): '\n Mock of de...
'Test if it clear out all of the data in the minion datastore'
def test_clear(self):
with patch('os.remove', MagicMock(return_value='')): with patch.dict(data.__opts__, {'cachedir': ''}): self.assertTrue(data.clear())
'Test if it return all of the data in the minion datastore'
def test_load(self):
with patch('salt.payload.Serial.load', MagicMock(return_value=True)): mocked_fopen = MagicMock(return_value=True) mocked_fopen.__enter__ = MagicMock(return_value=mocked_fopen) mocked_fopen.__exit__ = MagicMock() with patch('salt.utils.files.fopen', MagicMock(return_value=mocked_fopen...
'Test if it replace the entire datastore with a passed data structure'
def test_dump(self):
with patch.dict(data.__opts__, {'cachedir': '/'}): with patch('salt.utils.files.fopen', mock_open()): self.assertTrue(data.dump('{"eggs": "spam"}'))
'Test if it replace the entire datastore with a passed data structure'
def test_dump_isinstance(self):
with patch('ast.literal_eval', MagicMock(return_value='')): self.assertFalse(data.dump('salt'))
'Test if it replace the entire datastore with a passed data structure'
def test_dump_ioerror(self):
with patch.dict(data.__opts__, {'cachedir': '/'}): mock = MagicMock(side_effect=IOError('')) with patch('salt.utils.files.fopen', mock): self.assertFalse(data.dump('{"eggs": "spam"}'))