matthewdeanmartin / openmock

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

Missing methods and parameters in mocks #1

Open jaydm26 opened 2 years ago

jaydm26 commented 2 years ago

Hello,

I wanted to report an issue on a few missing methods and parameters in openmock when compared to opensearchpy.

e.g. openmock does not have a delete_by_query method for OpenSearch mocked client.

e.g. search method is missing track_total_hits for the OpenSearch mocked client.

e.g. The mocked indices client does not have a get_alias method.

I ran into these while using openmock, but I believe there will be more. Is there any plan of addressing them? I did not see a contributing guideline, and thus, didn't want to push code without knowing the correct steps. I am happy to write code to address these gaps.

matthewdeanmartin commented 1 year ago

I planned to do another round of importing code from elasticmock (but at some point, the code will be impossible to merge and elasticmock will start targeting things that opensearchpy doesn't have)

I'm open to any contribution that has passing tests.

hr004 commented 6 months ago

I am facing the same issue. It would be nice to have the delete_by_query method. My current workaround is to inherit FakeOpenSearch and reimplement the missing method.

matthewdeanmartin commented 6 months ago

@hr004 Get me that code by pull request and I'll get it merged in and published.

Don't worry too much about ceremony, I'm just a guy on the internet.