Files
opensearch-pyd/test_opensearchpy/test_async/test_plugins_client.py
T

26 lines
886 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# 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
from opensearchpy._async.client import AsyncOpenSearch
class TestPluginsClient(TestCase):
2023-11-06 13:08:19 -05:00
async def test_plugins_client(self) -> None:
with self.assertWarns(Warning) as w:
client = AsyncOpenSearch()
# testing double-init here
client.plugins.__init__(client) # type: ignore
self.assertEqual(
str(w.warnings[0].message),
"Cannot load `alerting` directly to AsyncOpenSearch as it already exists. Use `AsyncOpenSearch.plugin.alerting` instead.",
)