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
11 changes: 11 additions & 0 deletions tests/helpers/ptrack_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ def is_enterprise():
else:
return False

def is_nls_enabled():
cmd = [os.environ['PG_CONFIG'], '--configure']

p = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
return b'enable-nls' in p.communicate()[0]


class ProbackupException(Exception):
def __init__(self, message, cmd):
Expand Down Expand Up @@ -147,6 +157,7 @@ def slow_start(self, replica=False):
class ProbackupTest(object):
# Class attributes
enterprise = is_enterprise()
enable_nls = is_nls_enabled()

def __init__(self, *args, **kwargs):
super(ProbackupTest, self).__init__(*args, **kwargs)
Expand Down
16 changes: 10 additions & 6 deletions tests/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,13 @@ def test_options_5(self):
# @unittest.skip("skip")
def test_help_6(self):
"""help options"""
self.test_env['LC_ALL'] = 'ru_RU.utf-8'
with open(os.path.join(self.dir_path, "expected/option_help_ru.out"), "rb") as help_out:
self.assertEqual(
self.run_pb(["--help"]),
help_out.read().decode("utf-8")
)
if ProbackupTest.enable_nls:
self.test_env['LC_ALL'] = 'ru_RU.utf-8'
with open(os.path.join(self.dir_path, "expected/option_help_ru.out"), "rb") as help_out:
self.assertEqual(
self.run_pb(["--help"]),
help_out.read().decode("utf-8")
)
else:
return unittest.skip(
'You need configure PostgreSQL with --enabled-nls option for this test')