Merge .pyi type stubs inline (#563)
* Merged types into .py code. Signed-off-by: dblock <[email protected]> * Fix: nox -rs generate. Signed-off-by: dblock <[email protected]> * Updated CHANGELOG. Signed-off-by: dblock <[email protected]> * Use lowest common python version for lint. Signed-off-by: dblock <[email protected]> * Fix: don't typeshed. Signed-off-by: dblock <[email protected]> * Removed unneeded comment. Signed-off-by: dblock <[email protected]> * Simplify OPENSEARCH_URL. Signed-off-by: dblock <[email protected]> * Fix: positional ignore_status used as chunk_size. Signed-off-by: dblock <[email protected]> * Fix: parse version string. Signed-off-by: dblock <[email protected]> * Remove future annotations for Python 3.6. Signed-off-by: dblock <[email protected]> * Fix: types in documentation. Signed-off-by: dblock <[email protected]> * Improve CHANGELOG text. Signed-off-by: dblock <[email protected]> * Re-added missing separator. Signed-off-by: dblock <[email protected]> * Remove duplicate licenses. Signed-off-by: dblock <[email protected]> * Get rid of Optional[Any]. Signed-off-by: dblock <[email protected]> * Fix docs with AsyncOpenSearch. Signed-off-by: dblock <[email protected]> * Fix: undo comment. Signed-off-by: dblock <[email protected]> --------- Signed-off-by: dblock <[email protected]>
This commit is contained in:
@@ -14,12 +14,13 @@ from __future__ import unicode_literals
|
||||
import unittest
|
||||
|
||||
import pytest
|
||||
from _pytest.mark.structures import MarkDecorator
|
||||
|
||||
from opensearchpy.helpers.test import OPENSEARCH_VERSION
|
||||
|
||||
from .. import AsyncOpenSearchTestCase
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
pytestmark: MarkDecorator = pytest.mark.asyncio
|
||||
|
||||
|
||||
class TestAlertingPlugin(AsyncOpenSearchTestCase):
|
||||
@@ -43,7 +44,7 @@ class TestAlertingPlugin(AsyncOpenSearchTestCase):
|
||||
(OPENSEARCH_VERSION) and (OPENSEARCH_VERSION < (2, 0, 0)),
|
||||
"Plugin not supported for opensearch version",
|
||||
)
|
||||
async def test_get_destination(self):
|
||||
async def test_get_destination(self) -> None:
|
||||
# Create a dummy destination
|
||||
await self.test_create_destination()
|
||||
|
||||
@@ -123,7 +124,7 @@ class TestAlertingPlugin(AsyncOpenSearchTestCase):
|
||||
(OPENSEARCH_VERSION) and (OPENSEARCH_VERSION < (2, 0, 0)),
|
||||
"Plugin not supported for opensearch version",
|
||||
)
|
||||
async def test_search_monitor(self):
|
||||
async def test_search_monitor(self) -> None:
|
||||
# Create a dummy monitor
|
||||
await self.test_create_monitor()
|
||||
|
||||
@@ -141,7 +142,7 @@ class TestAlertingPlugin(AsyncOpenSearchTestCase):
|
||||
(OPENSEARCH_VERSION) and (OPENSEARCH_VERSION < (2, 0, 0)),
|
||||
"Plugin not supported for opensearch version",
|
||||
)
|
||||
async def test_get_monitor(self):
|
||||
async def test_get_monitor(self) -> None:
|
||||
# Create a dummy monitor
|
||||
await self.test_create_monitor()
|
||||
|
||||
@@ -165,7 +166,7 @@ class TestAlertingPlugin(AsyncOpenSearchTestCase):
|
||||
(OPENSEARCH_VERSION) and (OPENSEARCH_VERSION < (2, 0, 0)),
|
||||
"Plugin not supported for opensearch version",
|
||||
)
|
||||
async def test_run_monitor(self):
|
||||
async def test_run_monitor(self) -> None:
|
||||
# Create a dummy monitor
|
||||
await self.test_create_monitor()
|
||||
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import pytest
|
||||
from _pytest.mark.structures import MarkDecorator
|
||||
|
||||
from opensearchpy.exceptions import NotFoundError
|
||||
|
||||
from .. import AsyncOpenSearchTestCase
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
pytestmark: MarkDecorator = pytest.mark.asyncio
|
||||
|
||||
|
||||
class TestIndexManagementPlugin(AsyncOpenSearchTestCase):
|
||||
@@ -68,7 +69,7 @@ class TestIndexManagementPlugin(AsyncOpenSearchTestCase):
|
||||
}
|
||||
}
|
||||
|
||||
async def test_create_policy(self):
|
||||
async def test_create_policy(self) -> None:
|
||||
# Test to create policy
|
||||
response = await self.client.index_management.put_policy(
|
||||
policy=self.POLICY_NAME, body=self.POLICY_CONTENT
|
||||
@@ -77,7 +78,7 @@ class TestIndexManagementPlugin(AsyncOpenSearchTestCase):
|
||||
self.assertNotIn("errors", response)
|
||||
self.assertIn("_id", response)
|
||||
|
||||
async def test_get_policy(self):
|
||||
async def test_get_policy(self) -> None:
|
||||
# Create a policy
|
||||
await self.test_create_policy()
|
||||
|
||||
@@ -88,7 +89,7 @@ class TestIndexManagementPlugin(AsyncOpenSearchTestCase):
|
||||
self.assertIn("_id", response)
|
||||
self.assertEqual(response["_id"], self.POLICY_NAME)
|
||||
|
||||
async def test_update_policy(self):
|
||||
async def test_update_policy(self) -> None:
|
||||
# Create a policy
|
||||
await self.test_create_policy()
|
||||
|
||||
@@ -110,7 +111,7 @@ class TestIndexManagementPlugin(AsyncOpenSearchTestCase):
|
||||
self.assertNotIn("errors", response)
|
||||
self.assertIn("_id", response)
|
||||
|
||||
async def test_delete_policy(self):
|
||||
async def test_delete_policy(self) -> None:
|
||||
# Create a policy
|
||||
await self.test_create_policy()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user