Files
opensearch-pyd/test_opensearchpy/test_server_secured/test_clients.py
T

30 lines
866 B
Python
Raw Normal View History

# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
from unittest import TestCase
2021-09-16 14:59:29 +05:30
from opensearchpy import OpenSearch
from opensearchpy.helpers.test import OPENSEARCH_URL
class TestSecurity(TestCase):
2023-11-06 13:08:19 -05:00
def test_security(self) -> None:
client = OpenSearch(
OPENSEARCH_URL,
http_auth=("admin", "admin"),
verify_certs=False,
)
info = client.info()
self.assertNotEqual(info["version"]["number"], "")
self.assertNotEqual(info["tagline"], "")
self.assertTrue(
"build_flavor" in info["version"] or "distribution" in info["version"]
)