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

Commit92a4d56

Browse files
committed
Merge remote-tracking branch 'origin/REL_2_5' into REL_2_5
2 parents1f5991d +49bb374 commit92a4d56

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

‎tests/option_test.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from .helpers.ptrack_helpersimportProbackupTest,ProbackupException
44
importlocale
55

6-
76
classOptionTest(ProbackupTest,unittest.TestCase):
87

98
# @unittest.skip("skip")
@@ -220,12 +219,28 @@ def test_options_5(self):
220219
deftest_help_6(self):
221220
"""help options"""
222221
ifProbackupTest.enable_nls:
223-
self.test_env['LC_ALL']='ru_RU.utf-8'
224-
withopen(os.path.join(self.dir_path,"expected/option_help_ru.out"),"rb")ashelp_out:
225-
self.assertEqual(
226-
self.run_pb(["--help"]),
227-
help_out.read().decode("utf-8")
228-
)
222+
ifcheck_locale('ru_RU.utf-8'):
223+
self.test_env['LC_ALL']='ru_RU.utf-8'
224+
withopen(os.path.join(self.dir_path,"expected/option_help_ru.out"),"rb")ashelp_out:
225+
self.assertEqual(
226+
self.run_pb(["--help"]),
227+
help_out.read().decode("utf-8")
228+
)
229+
else:
230+
self.skipTest(
231+
"Locale ru_RU.utf-8 doesn't work. You need install ru_RU.utf-8 locale for this test")
229232
else:
230233
self.skipTest(
231234
'You need configure PostgreSQL with --enabled-nls option for this test')
235+
236+
237+
defcheck_locale(locale_name):
238+
ret=True
239+
old_locale=locale.setlocale(locale.LC_CTYPE,"")
240+
try:
241+
locale.setlocale(locale.LC_CTYPE,locale_name)
242+
exceptlocale.Error:
243+
ret=False
244+
finally:
245+
locale.setlocale(locale.LC_CTYPE,old_locale)
246+
returnret

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp