Files
opensearch-pyd/test_opensearchpy/test_client/test_point_in_time.py
T
Samuel OrjiandGitHub 6f26eb3e8e remove unnecessary utf-8 header in .py files (#615)
* remove unnecessary utf-8 header in .py files

Signed-off-by: samuel orji <[email protected]>

* review feedback: add link to changelog

Signed-off-by: samuel orji <[email protected]>

---------

Signed-off-by: samuel orji <[email protected]>
2023-11-24 16:19:50 -05:00

47 lines
1.8 KiB
Python

# 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")