Files
opensearch-pyd/test_opensearchpy/test_client/test_plugins/test_plugins_client.py
T
Daniel (dB.) DoubrovkineandGitHub 56c96d7c4f Expanded type coverage to benchmarks, samples and tests. (#566)
* Renamed json samples to fix duplicate module name.

Signed-off-by: dblock <dblock@amazon.com>

* Enabled mypy on all source files.

Signed-off-by: dblock <dblock@amazon.com>

* Added missing types.

Signed-off-by: dblock <dblock@amazon.com>

* Added CHANGELOG.

Signed-off-by: dblock <dblock@amazon.com>

* Move type: ignore to fix untyped decorator makes function untyped.

Signed-off-by: dblock <dblock@amazon.com>

* Fix nox -rs lint-3.7.

Signed-off-by: dblock <dblock@amazon.com>

* Fixed incorrect import.

Signed-off-by: dblock <dblock@amazon.com>

* Fix broken test.

Signed-off-by: dblock <dblock@amazon.com>

* Fixed TestBulk::test_bulk_works_with_bytestring_body.

Signed-off-by: dblock <dblock@amazon.com>

---------

Signed-off-by: dblock <dblock@amazon.com>
2023-11-09 10:51:20 -05:00

26 lines
845 B
Python

# -*- 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 opensearchpy.client import OpenSearch
from ...test_cases import TestCase
class TestPluginsClient(TestCase):
def test_plugins_client(self) -> None:
with self.assertWarns(Warning) as w:
client = OpenSearch()
# double-init
client.plugins.__init__(client) # type: ignore
self.assertEqual(
str(w.warnings[0].message),
"Cannot load `alerting` directly to OpenSearch as it already exists. Use `OpenSearch.plugin.alerting` instead.",
)