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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for molastic-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ac4b97b0ba22ae56407e89cf6a93dd5d60d85da08dc44f3e9b52df2ad85e21f2
MD5 a6ddbfad30251ffd875650ded2f2ba60
BLAKE2b-256 14cf7fd6acac7d08fab2521d58fdd88c310778f13ccdd74ab7e542ae973ec720

See more details on using hashes here.

File details

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

File metadata

  • Download URL: molastic-0.2.2-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.11.3

File hashes

Hashes for molastic-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ef3a746bb07ed76f8ae22911516c49d9d771a404be39cf30df93f5621182325a
MD5 22d48ae6811e0431e949e4fd4cff7f33
BLAKE2b-256 65548fe184951bd8d0bdd48af50e3ecb8841f94374cc086ac90699d5703c03c2

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