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.3.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.3-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: molastic-0.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 fa8252d1a0416a4202823c4134dc2fe223d6ca7e0ea706ffb7990ffd3a783560
MD5 17bc71fb5e661497a0ddda4465745217
BLAKE2b-256 054810e0a900ee0d4cb0673330ed5635739685c3cc11286d393bc8035bb7fdac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: molastic-0.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bc8cca144b9fdfc5918fa1853a73becb3c82ef96ae320fba0bb55c12703b5762
MD5 9226db4a5477232527c7b0cce6e5cfa2
BLAKE2b-256 9b0307789069972ca7b4dfbb711692cff648d0caec004df9825e343254bb0d60

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