Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@

import json
import unittest
from unittest.mock import patch

from pgadmin.model import Server
from pgadmin.utils.route import BaseTestGenerator
from regression.python_test_utils import test_utils as utils

LIBPQ_VERSION = 'pgadmin.utils.pg_oauth2.loaded_libpq_version'
LIBPQ_18 = 180000


class ServerKerberosExclusivityTestCase(BaseTestGenerator):

Expand Down Expand Up @@ -76,6 +80,11 @@ def setUp(self):
# server is needed.
unittest.TestCase.setUp(self)
self.server_id = None
# The token methods need libpq 18 or later, so patch the version
# for the scenarios to run the same on any libpq.
libpq = patch(LIBPQ_VERSION, return_value=LIBPQ_18)
libpq.start()
self.addCleanup(libpq.stop)

def _url(self, *parts):
return '/browser/server/obj/{0}/'.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
from pgadmin.utils.route import BaseTestGenerator

ServerNode = servers_module.ServerNode
LIBPQ_VERSION = 'pgadmin.utils.pg_oauth2.loaded_libpq_version'
LIBPQ_18 = 180000
SHOWN = ('db.example.com', 5432, {'sslmode': 'verify-full'})


Expand All @@ -49,6 +51,11 @@ def setUp(self):
self.app = Flask(__name__)
self.app.config.update(SECRET_KEY='unit-test', TESTING=True)
Babel(self.app)
# The OAuth methods need libpq 18 or later, so patch the version
# for the scenarios to run the same on any libpq.
libpq = patch(LIBPQ_VERSION, return_value=LIBPQ_18)
libpq.start()
self.addCleanup(libpq.stop)

def runTest(self):
server = SimpleNamespace(
Expand Down
Loading