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, Exists
  • 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.4.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

molastic-0.2.4-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

Details for the file molastic-0.2.4.tar.gz.

File metadata

  • Download URL: molastic-0.2.4.tar.gz
  • Upload date:
  • Size: 51.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for molastic-0.2.4.tar.gz
Algorithm Hash digest
SHA256 01141c059ad9de78248f2ba3c149edc7f9f14e0fe58ca216e1e7a000704d2fd6
MD5 8babc952d53e66a3d196860d5761b0a5
BLAKE2b-256 4b5b3c99a9ddca5880cf0263f4938429bd50f67a92fb2c87c71887ec4cd2f4d6

See more details on using hashes here.

File details

Details for the file molastic-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: molastic-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 56.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for molastic-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 81a082c3e91718a60a9fe45a42c535b3284de3e3b75cb5bfcc1ff57a45acf0c3
MD5 fd68b2c8b19d0e609005d43c0e65fe14
BLAKE2b-256 bda20879098ffe1d84c8de51054fa7c222e0ba208f87324665c2c070e77abc58

See more details on using hashes here.

Supported by

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