matthewdeanmartin / openmock

Python Opensearch Mock for test purposes (fork of elasticmock)
https://pypi.python.org/pypi/openmock
MIT License
12 stars 11 forks source link

updated exists method to ignore doctype checks when None #11

Closed sdhoyt closed 1 year ago

sdhoyt commented 1 year ago

Change Overview

Currently, the exists() method in FakeOpenSearch relies on getting a document type that is used alongside the index and document id when checking if a document exists. If a document type is not input, it defaults to None and will return false because it checks, for example, if the document type "_doc" == None.

The opensearchpy implementation does not need a document type input and only needs the index name and document id to check for the existence of the document. In openmock, the exists method should ignore whether the document type matches when the value is None.

File Changes