测试用python elasticsearch模拟
ElasticMock的Python项目详细描述
#elasticmock
python elasticsearch mock用于测试目的
[![构建状态](https://travis-ci.org/vrcmarcos/elasticmock.svg?branch=master)(https://travis-ci.org/vrcmarcos/elasticmock)[![覆盖状态](https://coveralls.io/repos/github/vrcmarcos/elasticmock/badge.svg?branch=master)(https://coveralls.io/github/vrcmarcos/elasticmock?branch=master)[![PYPI版本](https://badge.fury.io/py/elasticmock.svg)(https://badge.fury.io/py/elasticmock)[![代码运行状况](https://landscape.io/github/vrcmarcos/elasticmock/master/landscape.svg?style=flat)(https://landscape.io/github/vrcmarcos/elasticmock/master)[![github许可证](https://img.shields.io/badge/license mit blue.svg)](https://raw.githubusercontent.com/vrcmarcos/elasticmock/master/license)
**@elasticmock**decorator:
`` python
来自unittest import testcase
nction_使用_elasticsearch())
```
ElasticSearch.建议回复。**ATention:**如果术语是*int*,建议使用``python term+1```。否则,建议将被格式化为``python{0}u suggestion.format(term)``.
示例:
-**建议正文**:
``python
建议正文={
'建议字符串':{
'文本':'测试正文',
'术语':{
'字段':'字符串'
}
},
'建议id':{
'文本':1234567,
'术语':{
'字段':'id'
}
}
}
}
``````
-**建议响应**:
``python
{
'sugg估计字符串":[
{
‘文本’:‘测试文本’,
‘长度’:1,
‘选项’:[
{
‘文本’:‘测试文本建议’,
‘频率’:1,
‘sc矿石:1.0
}
],
"偏移量":0
}
],
"建议ID":[
{
"文本":1234567,
"长度":1,
"选项":[
{
"文本":1234568,
"频率":1,
"分数":1.0
}
],
"偏移量":0
}
],
}
`````
python setup.py test
````
.5
-[修复1.3.4版本](https://github.com/vrcmarcos/elasticmock/pull/19)(感谢[@infinite joy](https://github.com/infinite joy))
1.3.4
-[根据请求添加聚合以响应](https://github.com/vrcmarcos/elasticmock/pull/15)(感谢[@snakey](https://github.com/snakey))
-[实现滚动的新方法](https://github.com/vrcmarcos/elasticmock/pull/17)(感谢[@tcatrain](https://github.com/tcatrain))
1.3
-[搜索:文档类型可以是列表](https://github.com/vrcmarcos/elasticmock/pull/16)(感谢[@garncarz](https://github.com/gar)ncarz))
-[排除测试包](https://github.com/vrcmarcos/elasticmock/pull/13)(感谢[@jmlw](https://github.com/jmlw))
-[使fakeelasticsearch初始签名与来自elasticsearc的签名匹配]((https://github.com/vrcmarcos/elasticmock/pull/10)(感谢[@xrmx](https://github.c)om/xrmx))
-[改进搜索和计数](https://github.com/vrcmarcos/elasticmock/pull/7)(感谢[@frivoire](https://github.com/frivoire))
\frivoire;(1.3.2
-**elasticmock**:python 3修复(感谢[@barseghyanartur](https://github.com/barseghyanartur))
-**测试**:添加信息n在测试中(感谢[@barseghyanartur](https://github.com/barseghyanartur))
-**readme.md**:修复了输入错误(感谢[@bowloftest](https://github.com/bowloftest))
1.3.1
-**elasticmock**:允许elasticsearch.elasticsearch允许的相同参数马布里顿(https://github.com/mattbreeden)网站
<
\ 1.3.0:
-**fakeellasticSearch**:mocked****count**方法(感谢[@theoresources[@theoresources(https://github.com/theoresources))
> 1.1.1:
-**弹性模拟**:更改清理旧fakeelasticsearch实例的顺序
-**fakeelasticsearch.index**:更改方法签名以正确重写elasticsearch.index方法
ixed github link
1.0.0:
-**elasticmock**:created**@elasticmock**decorator
-**fakeelasticsearch**:mocked**exists**,**get**,**get**source**,**index**,**info**,**search**和**ping**方法
python elasticsearch mock用于测试目的
[![构建状态](https://travis-ci.org/vrcmarcos/elasticmock.svg?branch=master)(https://travis-ci.org/vrcmarcos/elasticmock)[![覆盖状态](https://coveralls.io/repos/github/vrcmarcos/elasticmock/badge.svg?branch=master)(https://coveralls.io/github/vrcmarcos/elasticmock?branch=master)[![PYPI版本](https://badge.fury.io/py/elasticmock.svg)(https://badge.fury.io/py/elasticmock)[![代码运行状况](https://landscape.io/github/vrcmarcos/elasticmock/master/landscape.svg?style=flat)(https://landscape.io/github/vrcmarcos/elasticmock/master)[![github许可证](https://img.shields.io/badge/license mit blue.svg)](https://raw.githubusercontent.com/vrcmarcos/elasticmock/master/license)
**@elasticmock**decorator:
`` python
来自unittest import testcase
nction_使用_elasticsearch())
```
ElasticSearch.建议回复。**ATention:**如果术语是*int*,建议使用``python term+1```。否则,建议将被格式化为``python{0}u suggestion.format(term)``.
示例:
-**建议正文**:
``python
建议正文={
'建议字符串':{
'文本':'测试正文',
'术语':{
'字段':'字符串'
}
},
'建议id':{
'文本':1234567,
'术语':{
'字段':'id'
}
}
}
}
``````
-**建议响应**:
``python
{
'sugg估计字符串":[
{
‘文本’:‘测试文本’,
‘长度’:1,
‘选项’:[
{
‘文本’:‘测试文本建议’,
‘频率’:1,
‘sc矿石:1.0
}
],
"偏移量":0
}
],
"建议ID":[
{
"文本":1234567,
"长度":1,
"选项":[
{
"文本":1234568,
"频率":1,
"分数":1.0
}
],
"偏移量":0
}
],
}
`````
python setup.py test
````
.5
-[修复1.3.4版本](https://github.com/vrcmarcos/elasticmock/pull/19)(感谢[@infinite joy](https://github.com/infinite joy))
1.3.4
-[根据请求添加聚合以响应](https://github.com/vrcmarcos/elasticmock/pull/15)(感谢[@snakey](https://github.com/snakey))
-[实现滚动的新方法](https://github.com/vrcmarcos/elasticmock/pull/17)(感谢[@tcatrain](https://github.com/tcatrain))
1.3
-[搜索:文档类型可以是列表](https://github.com/vrcmarcos/elasticmock/pull/16)(感谢[@garncarz](https://github.com/gar)ncarz))
-[排除测试包](https://github.com/vrcmarcos/elasticmock/pull/13)(感谢[@jmlw](https://github.com/jmlw))
-[使fakeelasticsearch初始签名与来自elasticsearc的签名匹配]((https://github.com/vrcmarcos/elasticmock/pull/10)(感谢[@xrmx](https://github.c)om/xrmx))
-[改进搜索和计数](https://github.com/vrcmarcos/elasticmock/pull/7)(感谢[@frivoire](https://github.com/frivoire))
\frivoire;(1.3.2
-**elasticmock**:python 3修复(感谢[@barseghyanartur](https://github.com/barseghyanartur))
-**测试**:添加信息n在测试中(感谢[@barseghyanartur](https://github.com/barseghyanartur))
-**readme.md**:修复了输入错误(感谢[@bowloftest](https://github.com/bowloftest))
1.3.1
-**elasticmock**:允许elasticsearch.elasticsearch允许的相同参数马布里顿(https://github.com/mattbreeden)网站
<
\ 1.3.0:
-**fakeellasticSearch**:mocked****count**方法(感谢[@theoresources[@theoresources(https://github.com/theoresources))
>
-**弹性模拟**:更改清理旧fakeelasticsearch实例的顺序
-**fakeelasticsearch.index**:更改方法签名以正确重写elasticsearch.index方法
ixed github link
1.0.0:
-**elasticmock**:created**@elasticmock**decorator
-**fakeelasticsearch**:mocked**exists**,**get**,**get**source**,**index**,**info**,**search**和**ping**方法