File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ def test_configure_opensearch_client_for_localhost():
2525 assert str (result ) == "<OpenSearch([{'host': 'localhost', 'port': '9200'}])>"
2626
2727
28+ def test_configure_opensearch_client_for_local_opensearch_host ():
29+ result = tim_os .configure_opensearch_client ("opensearch" )
30+ assert str (result ) == "<OpenSearch([{'host': 'opensearch', 'port': '9200'}])>"
31+
32+
2833@mock .patch ("boto3.session.Session" )
2934def test_configure_opensearch_client_for_aws (mocked_boto3_session ): # noqa
3035 result = tim_os .configure_opensearch_client ("fake-dev.us-east-1.es.amazonaws.com" )
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def configure_opensearch_client(url: str) -> OpenSearch:
3434 Includes the appropriate AWS credentials configuration if the URL is not localhost.
3535 """
3636 logger .info ("OpenSearch request configurations: %s" , REQUEST_CONFIG )
37- if url == "localhost" :
37+ if url in [ "localhost" , "opensearch" ] :
3838 return OpenSearch (
3939 hosts = [{"host" : url , "port" : "9200" }],
4040 http_auth = ("admin" , "admin" ),
You can’t perform that action at this time.
0 commit comments