mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Hide tablespace node on GPDB. Fixes #3107
This commit is contained in:
parent
bcb6f37d6f
commit
ba70634e5f
@ -32,6 +32,10 @@ class TablespaceModule(CollectionNodeModule):
|
||||
NODE_TYPE = 'tablespace'
|
||||
COLLECTION_LABEL = gettext("Tablespaces")
|
||||
|
||||
def __init__(self, import_name, **kwargs):
|
||||
super(TablespaceModule, self).__init__(import_name, **kwargs)
|
||||
self.min_gpdbver = 90000
|
||||
|
||||
def get_nodes(self, gid, sid):
|
||||
"""
|
||||
Generate the collection node
|
||||
|
@ -0,0 +1,46 @@
|
||||
##########################################################################
|
||||
#
|
||||
# pgAdmin 4 - PostgreSQL Tools
|
||||
#
|
||||
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
||||
# This software is released under the PostgreSQL Licence
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
from mock import MagicMock
|
||||
|
||||
from pgadmin.browser.server_groups.servers.tablespaces import TablespaceModule
|
||||
from pgadmin.utils.route import BaseTestGenerator
|
||||
|
||||
|
||||
class BackendSupportedTestCase(BaseTestGenerator):
|
||||
"""This class will add tablespace node under server"""
|
||||
scenarios = [
|
||||
('When server is postgres, it returns true',
|
||||
dict(
|
||||
manager=dict(
|
||||
sversion=90100,
|
||||
server_type='pg'
|
||||
),
|
||||
expected_result=True
|
||||
)),
|
||||
('When server is GreenPlum 5.0, it returns false',
|
||||
dict(
|
||||
manager=dict(
|
||||
sversion=80323,
|
||||
server_type='gpdb'
|
||||
),
|
||||
expected_result=False
|
||||
))
|
||||
]
|
||||
class LocalManager:
|
||||
def __init__(self, properties):
|
||||
self.sversion = properties['sversion']
|
||||
self.sversion = properties['sversion']
|
||||
|
||||
def runTest(self):
|
||||
module = TablespaceModule('name')
|
||||
manager = MagicMock()
|
||||
manager.sversion = self.manager['sversion']
|
||||
manager.server_type = self.manager['server_type']
|
||||
self.assertEquals(self.expected_result, module.BackendSupported(manager))
|
Loading…
Reference in New Issue
Block a user