Fix nox generate (#830)
* Fix: don't rely on a specific plugin for the test. Signed-off-by: dblock <[email protected]> * Ignore ISM. Signed-off-by: dblock <[email protected]> --------- Signed-off-by: dblock <[email protected]>
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
# GitHub history for details.
|
# GitHub history for details.
|
||||||
|
|
||||||
|
|
||||||
|
import re
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@@ -24,8 +25,7 @@ class TestPluginsClient:
|
|||||||
client = AsyncOpenSearch()
|
client = AsyncOpenSearch()
|
||||||
# testing double-init here
|
# testing double-init here
|
||||||
client.plugins.__init__(client) # type: ignore # pylint: disable=unnecessary-dunder-call
|
client.plugins.__init__(client) # type: ignore # pylint: disable=unnecessary-dunder-call
|
||||||
assert (
|
assert re.match(
|
||||||
str(w[0].message)
|
r"Cannot load `\w+` directly to AsyncOpenSearch as it already exists. Use `AsyncOpenSearch.plugin.\w+` instead.",
|
||||||
== "Cannot load `alerting` directly to AsyncOpenSearch as it already exists. Use "
|
str(w[0].message),
|
||||||
"`AsyncOpenSearch.plugin.alerting` instead."
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
# Modifications Copyright OpenSearch Contributors. See
|
# Modifications Copyright OpenSearch Contributors. See
|
||||||
# GitHub history for details.
|
# GitHub history for details.
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
from opensearchpy.client import OpenSearch
|
from opensearchpy.client import OpenSearch
|
||||||
|
|
||||||
from ...test_cases import TestCase
|
from ...test_cases import TestCase
|
||||||
@@ -18,8 +20,9 @@ class TestPluginsClient(TestCase):
|
|||||||
client = OpenSearch()
|
client = OpenSearch()
|
||||||
# double-init
|
# double-init
|
||||||
client.plugins.__init__(client) # type: ignore # pylint: disable=unnecessary-dunder-call
|
client.plugins.__init__(client) # type: ignore # pylint: disable=unnecessary-dunder-call
|
||||||
self.assertEqual(
|
self.assertTrue(
|
||||||
|
re.match(
|
||||||
|
r"Cannot load `\w+` directly to OpenSearch as it already exists. Use `OpenSearch.plugin.\w+` instead.",
|
||||||
str(w.warnings[0].message),
|
str(w.warnings[0].message),
|
||||||
"Cannot load `alerting` directly to OpenSearch as "
|
)
|
||||||
"it already exists. Use `OpenSearch.plugin.alerting` instead.",
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -704,6 +704,10 @@ def read_modules() -> Any:
|
|||||||
namespace = "__init__"
|
namespace = "__init__"
|
||||||
name = key
|
name = key
|
||||||
|
|
||||||
|
# FIXME: we have a hard-coded index_management that needs to be deprecated in favor of the auto-generated one
|
||||||
|
if namespace == "ism":
|
||||||
|
continue
|
||||||
|
|
||||||
# Group the data in the current group by the "path" key
|
# Group the data in the current group by the "path" key
|
||||||
paths = []
|
paths = []
|
||||||
all_paths_have_deprecation = True
|
all_paths_have_deprecation = True
|
||||||
|
|||||||
Reference in New Issue
Block a user