Files
opensearch-pyd/test_opensearchpy/test_client/test_point_in_time.py
T
Daniel (dB.) DoubrovkineandGitHub dcb79cc322 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]>
2023-11-06 10:08:19 -08:00

48 lines
1.8 KiB
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 test_opensearchpy.test_cases import OpenSearchTestCase
class TestPointInTime(OpenSearchTestCase):
def test_create_one_point_in_time(self) -> None:
index_name = "test-index"
self.client.create_point_in_time(index=index_name)
self.assert_url_called("POST", "/test-index/_search/point_in_time")
def test_delete_one_point_in_time(self) -> None:
self.client.delete_point_in_time(body={"pit_id": ["Sample-PIT-ID"]})
self.assert_url_called("DELETE", "/_search/point_in_time")
def test_delete_all_point_in_time(self) -> None:
self.client.delete_point_in_time(all=True)
self.assert_url_called("DELETE", "/_search/point_in_time/_all")
def test_list_all_point_in_time(self) -> None:
self.client.list_all_point_in_time()
self.assert_url_called("GET", "/_search/point_in_time/_all")
def test_create_pit(self) -> None:
index_name = "test-index"
self.client.create_pit(index=index_name)
self.assert_url_called("POST", "/test-index/_search/point_in_time")
def test_delete_pit(self) -> None:
self.client.delete_pit(body={"pit_id": ["Sample-PIT-ID"]})
self.assert_url_called("DELETE", "/_search/point_in_time")
def test_delete_all_pits(self) -> None:
self.client.delete_all_pits()
self.assert_url_called("DELETE", "/_search/point_in_time/_all")
def test_get_all_pits(self) -> None:
self.client.get_all_pits()
self.assert_url_called("GET", "/_search/point_in_time/_all")