pgadmin4/web/pgadmin/dashboard/tests/test_replication.py
Aditya Toshniwal ace73ebb60
Added support for viewing Log Based Clusters. #7216
Co-authored-by: Akshay Joshi <akshay.joshi@enterprisedb.com>
2024-03-28 12:19:34 +05:30

51 lines
1.5 KiB
Python

##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2024, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from pgadmin.utils.route import BaseTestGenerator
from pgadmin.utils import server_utils
from regression import parent_node_dict
import json
class DashboardReplicationTestCase(BaseTestGenerator):
"""
This class validates the version in range functionality
by defining different version scenarios; where dict of
parameters describes the scenario appended by test name.
"""
scenarios = [(
'TestCase for replication slots', dict(
endpoint='/dashboard/replication_slots',
data=[],
)), (
'TestCase for replication stats', dict(
endpoint='/dashboard/replication_stats',
data=[],
)),
]
def setUp(self):
pass
def runTest(self):
self.server_id = parent_node_dict["server"][-1]["server_id"]
server_response = server_utils.connect_server(self, self.server_id)
if server_response["info"] == "Server connected.":
url = self.endpoint + '/{0}'.format(self.server_id)
response = self.tester.get(url)
self.assertEqual(response.status_code, 200)
else:
raise Exception("Error while connecting server to add the"
" database.")
def tearDown(self):
pass