test_controllers.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:metastore 作者: datahq 项目源码 文件源码
def setUp(self):

        # Clean index
        self.es = Elasticsearch(hosts=[LOCAL_ELASTICSEARCH])
        try:
            self.es.indices.delete(index='datahub')
            self.es.indices.delete(index='events')
        except NotFoundError:
            pass
        self.es.indices.create('datahub')
        mapping = {'dataset': {'properties': self.MAPPING}}
        self.es.indices.put_mapping(doc_type='dataset',
                                    index='datahub',
                                    body=mapping)

        self.es.indices.create('events')
        mapping = {'event': {'properties': {'timestamp': {'type': 'date'}}}}
        self.es.indices.put_mapping(doc_type='event',
                                    index='events',
                                    body=mapping)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号