Skip to content

Commit 786ccf0

Browse files
authored
Merge pull request #501 from postgrespro/enable_nls_check
Add checking enable-nls option in configure
2 parents 7591667 + f544da1 commit 786ccf0

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

tests/helpers/ptrack_helpers.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ def is_enterprise():
101101
else:
102102
return False
103103

104+
def is_nls_enabled():
105+
cmd = [os.environ['PG_CONFIG'], '--configure']
106+
107+
p = subprocess.Popen(
108+
cmd,
109+
stdout=subprocess.PIPE,
110+
stderr=subprocess.PIPE
111+
)
112+
return b'enable-nls' in p.communicate()[0]
113+
104114

105115
class ProbackupException(Exception):
106116
def __init__(self, message, cmd):
@@ -147,6 +157,7 @@ def slow_start(self, replica=False):
147157
class ProbackupTest(object):
148158
# Class attributes
149159
enterprise = is_enterprise()
160+
enable_nls = is_nls_enabled()
150161

151162
def __init__(self, *args, **kwargs):
152163
super(ProbackupTest, self).__init__(*args, **kwargs)

tests/option.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,13 @@ def test_options_5(self):
231231
# @unittest.skip("skip")
232232
def test_help_6(self):
233233
"""help options"""
234-
self.test_env['LC_ALL'] = 'ru_RU.utf-8'
235-
with open(os.path.join(self.dir_path, "expected/option_help_ru.out"), "rb") as help_out:
236-
self.assertEqual(
237-
self.run_pb(["--help"]),
238-
help_out.read().decode("utf-8")
239-
)
234+
if ProbackupTest.enable_nls:
235+
self.test_env['LC_ALL'] = 'ru_RU.utf-8'
236+
with open(os.path.join(self.dir_path, "expected/option_help_ru.out"), "rb") as help_out:
237+
self.assertEqual(
238+
self.run_pb(["--help"]),
239+
help_out.read().decode("utf-8")
240+
)
241+
else:
242+
return unittest.skip(
243+
'You need configure PostgreSQL with --enabled-nls option for this test')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy