Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit039e3c8

Browse files
committed
Add checking enable-nls option in configure For correct work test_help_6 we need skip this test if PostgreSQL configured without --enable-nls
1 parentacc8edc commit039e3c8

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

‎tests/helpers/ptrack_helpers.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,19 @@ def is_enterprise():
101101
else:
102102
returnFalse
103103

104+
defenable_nls():
105+
cmd= [os.environ['PG_CONFIG'],'--configure']
106+
107+
p=subprocess.Popen(
108+
cmd,
109+
stdout=subprocess.PIPE,
110+
stderr=subprocess.PIPE
111+
)
112+
ifb'enable-nls'inp.communicate()[0]:
113+
returnTrue
114+
else:
115+
returnFalse
116+
104117

105118
classProbackupException(Exception):
106119
def__init__(self,message,cmd):
@@ -147,6 +160,7 @@ def slow_start(self, replica=False):
147160
classProbackupTest(object):
148161
# Class attributes
149162
enterprise=is_enterprise()
163+
enable_nls=enable_nls()
150164

151165
def__init__(self,*args,**kwargs):
152166
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
deftest_help_6(self):
233233
"""help options"""
234-
self.test_env['LC_ALL']='ru_RU.utf-8'
235-
withopen(os.path.join(self.dir_path,"expected/option_help_ru.out"),"rb")ashelp_out:
236-
self.assertEqual(
237-
self.run_pb(["--help"]),
238-
help_out.read().decode("utf-8")
239-
)
234+
ifProbackupTest.enable_nls:
235+
self.test_env['LC_ALL']='ru_RU.utf-8'
236+
withopen(os.path.join(self.dir_path,"expected/option_help_ru.out"),"rb")ashelp_out:
237+
self.assertEqual(
238+
self.run_pb(["--help"]),
239+
help_out.read().decode("utf-8")
240+
)
241+
else:
242+
returnunittest.skip(
243+
'You need configure PostgreSQL with --enabled-nls option for this test')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp