文件名称:elasticmock:用于测试目的的Python Elasticsearch Mock
文件大小:33KB
文件格式:ZIP
更新时间:2024-05-27 00:13:48
python mock elasticsearch decorators python3
弹性模拟 用于测试目的的Python Elasticsearch Mock 安装 pip install ElasticMock 用法 要使用ElasticMock,请使用@elasticmock装饰器装饰您的测试方法: from unittest import TestCase from elasticmock import elasticmock class TestClass ( TestCase ): @ elasticmock def test_should_return_something_from_elasticsearch ( self ): self . assertIsNotNone ( some_function_that_uses_elasticsearch ()) 自定义行为 您还可以通过导入elasticmock.behavio
【文件预览】:
elasticmock-master
----MANIFEST.in(18B)
----.travis.yml(171B)
----tests()
--------fake_elasticsearch()
--------__init__.py(488B)
--------fake_cluster()
--------fake_indices()
--------tox_banner.py(263B)
----tox.ini(595B)
----requirements_test.txt(17B)
----LICENSE(1KB)
----elasticmock()
--------fake_cluster.py(1KB)
--------behaviour()
--------fake_indices.py(1KB)
--------utilities()
--------fake_elasticsearch.py(30KB)
--------__init__.py(889B)
----setup.cfg(72B)
----requirements.txt(53B)
----setup.py(1KB)
----.gitignore(4KB)
----Makefile(564B)
----README.md(11KB)