Skip to main content

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: Text, SearchAsYouType, Long, Float, Double, Boolean, Keyword, Date, Geopoint, Geoshape
  • Analyzers: Standard
  • Document APIs: Index, Update, Delete, Get
  • Index APIs: Create index, Delete index, Exists, Update mapping, Get Mapping
    • Multi-Fields
  • Queries DSL supported: DisjunctionMaxQuery, Boolean, Match, MatchBoolPrefix, MultiMatch, MatchAll, Term, Prefix, Range, Geoshape, Geodistance
  • Scripting: painless (but maps cannot be accessed by dot notation)

Project details


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.2.1.tar.gz (51.8 kB view hashes)

Uploaded Source

Built Distribution

molastic-0.2.1-py3-none-any.whl (56.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page