You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I was looking at #87, and elasticmock's lack of support for the Elasticsearch.update function, I found that this lack of support is a bit non-obvious: the mocker doesn't implement the function, so it falls through to the super class which does the real thing, which tries to contact the server but if there is no server then it fails with ConnectionRefused. It's a little obscure to interpret this as a "not supported" error, but I wonder if there could also be worse implications for someone who does have an important running server on their local machine and accidentally starts modifying real data on that server during their tests when they believe that they are safely mocking? Either way, I wonder if it's in our power to give a more meaningful error message in these cases e.g. override all the super methods to catch a ConnectionRefused and turn it into a NotImplementedError?
The text was updated successfully, but these errors were encountered:
While I was looking at #87, and
elasticmock
's lack of support for theElasticsearch.update
function, I found that this lack of support is a bit non-obvious: the mocker doesn't implement the function, so it falls through to the super class which does the real thing, which tries to contact the server but if there is no server then it fails with ConnectionRefused. It's a little obscure to interpret this as a "not supported" error, but I wonder if there could also be worse implications for someone who does have an important running server on their local machine and accidentally starts modifying real data on that server during their tests when they believe that they are safely mocking? Either way, I wonder if it's in our power to give a more meaningful error message in these cases e.g. override all the super methods to catch a ConnectionRefused and turn it into a NotImplementedError?The text was updated successfully, but these errors were encountered: