#2768 tests: fix locale setting
Merged 3 years ago by tkopecek. Opened 3 years ago by tkopecek.
tkopecek/koji issue2767  into  master

@@ -1,5 +1,6 @@ 

  from __future__ import absolute_import

  import koji

+ import locale

  import mock

  import os

  import time
@@ -11,6 +12,8 @@ 

  

  class TestRpminfo(utils.CliTestCase):

      def setUp(self):

+         # force locale to compare 'expect' value

+         locale.setlocale(locale.LC_ALL, ('en_US', 'UTF-8'))

          self.maxDiff = None

          self.options = mock.MagicMock()

          self.options.quiet = True
@@ -52,6 +55,7 @@ 

                             'size': 7030}

  

      def tearDown(self):

+         locale.resetlocale()

          if self.original_timezone is None:

              del os.environ['TZ']

          else:

file modified
+2 -2
@@ -192,8 +192,8 @@ 

      @mock.patch('koji_cli.commands.activate_session')

      def assert_help(self, callableObj, message, activate_session_mock):

          # optarse uses gettext directly and it is driven by LANGUAGE

-         # we need engligsh to get comparable strings

-         os.environ['LANGUAGE'] = 'en_GB'

+         # we need english to get comparable strings

+         os.environ['LANGUAGE'] = 'C'

          self.assert_system_exit(

              callableObj,

              mock.MagicMock(),

Metadata Update from @tkopecek:
- Pull-request tagged with: no_qe

3 years ago

rebased onto 8ed86e8

3 years ago

Commit 9df4b1f fixes this pull-request

Pull-Request has been merged by tkopecek

3 years ago