Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)

src/r/a/rawes-HEAD/tests/core_tests.py   rawes(Download)
    def _reset_indices(self, es):
        # If the index does not exist, test creating it and deleting it
        try:
            es.get('%s/_status' % config.ES_INDEX)
        except ElasticException:
            es.put(config.ES_INDEX)
 
        # Test deleting the index
        es.delete(config.ES_INDEX)
        es.delete(config.ES_INDEX)
        try:
            es.get('%s/_status' % config.ES_INDEX)['status']
            self.assertTrue(False)
        except ElasticException as e:
            self.assertTrue(e.status_code == 404)
 
        # Now remake the index
        es.put(config.ES_INDEX)

src/r/a/rawes-0.5.5/tests/core_tests.py   rawes(Download)
    def _reset_indices(self, es):
        # If the index does not exist, test creating it and deleting it
        try:
            es.get('%s/_status' % config.ES_INDEX)
        except ElasticException:
            es.put(config.ES_INDEX)
 
        # Test deleting the index
        es.delete(config.ES_INDEX)
        es.delete(config.ES_INDEX)
        try:
            es.get('%s/_status' % config.ES_INDEX)['status']
            self.assertTrue(False)
        except ElasticException as e:
            self.assertTrue(e.status_code == 404)
 
        # Now remake the index
        es.put(config.ES_INDEX)