Library to easymock out elasticsearch for your tests
Project description
Molastic
Install
$ pip install molastic
Quickstart
Molastic is a library to easymock out elasticsearch for your tests
import molastic
import requests
def test_something():
base_url = 'mock://elastic'
with molastic.mock_elasticsearch(base_url):
requests.post(
url=f'{base_url}/my-index/_doc',
json={
"user": {
"id": "kimchy"
}
}
)
Features
- Types supported: Long, Float, Boolean, Keyword, Date, Geopoint, Geoshape
- Index operations: Create index, Update mapping
- Document APIs: Index, Update, Delete
- Index APIs: Create index, Update mapping
- Queries DSL supported: Boolean, MatchAll, Term, Range, Geoshape, Geodistance,
- Scripting: painless (but maps cannot be accessed by dot notation)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
molastic-0.0.1.tar.gz
(39.0 kB
view hashes)
Built Distribution
molastic-0.0.1-py3-none-any.whl
(40.7 kB
view hashes)