mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
GPDB compatibility fixes:
When connected to a Greenplum database server - Hide items that not work with GPDB, such as Triggers, FDW, FTS_*, etc - Tables/Views/Catalogs/Language node can expand correctly - Views/Languages/Catalogs can show properties dialog with correct information - Show a greenplum icon at the server node Teng Zhang & Hao Wang
This commit is contained in:
68
web/pgadmin/browser/tests/test_version_in_range.py
Normal file
68
web/pgadmin/browser/tests/test_version_in_range.py
Normal file
@@ -0,0 +1,68 @@
|
||||
##########################################################################
|
||||
#
|
||||
# pgAdmin 4 - PostgreSQL Tools
|
||||
#
|
||||
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
|
||||
# This software is released under the PostgreSQL Licence
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
import json
|
||||
import uuid
|
||||
|
||||
from pgadmin.utils.route import BaseTestGenerator
|
||||
from regression.python_test_utils import test_utils
|
||||
from regression.test_setup import config_data
|
||||
from pgadmin.browser.utils import is_version_in_range
|
||||
|
||||
|
||||
class VersionInRangeTestCase(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 Validating pgversion 8.23 and min_version is 91000, should not show', dict(
|
||||
sversion=82300,
|
||||
min_version=90100,
|
||||
max_version=1000000000,
|
||||
scenario=2
|
||||
)),
|
||||
('TestCase for Validating pgversion 9.2 and should show by default', dict(
|
||||
sversion=90200,
|
||||
min_version=0,
|
||||
max_version=1000000000,
|
||||
scenario=1
|
||||
)),
|
||||
('TestCase for Validating pgversion 9.2 and min/max are None, should show by default', dict(
|
||||
sversion=90200,
|
||||
min_version=None,
|
||||
max_version=None,
|
||||
scenario=1
|
||||
)),
|
||||
('TestCase for Validating pgversion 9.6 and max is lower, should not show', dict(
|
||||
sversion=90600,
|
||||
min_version=None,
|
||||
max_version=90400,
|
||||
scenario=2
|
||||
))
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
pass
|
||||
|
||||
def runTest(self):
|
||||
"""This function will check version in range functionality."""
|
||||
if self.scenario == 1:
|
||||
self.test_result_is_true()
|
||||
if self.scenario == 2:
|
||||
self.test_result_is_false()
|
||||
|
||||
def test_result_is_true(self):
|
||||
self.assertTrue(is_version_in_range(self.sversion, self.min_version, self.max_version))
|
||||
|
||||
def test_result_is_false(self):
|
||||
self.assertFalse(is_version_in_range(self.sversion, self.min_version, self.max_version))
|
||||
Reference in New Issue
Block a user