~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_i18n.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-14 16:38:55 UTC
  • mto: This revision was merged to the branch mainline in revision 6139.
  • Revision ID: jriddell@canonical.com-20110914163855-9cca2bre4qpoj09r
make TestInstall tests more consistent

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
 
98
98
class TestInstall(tests.TestCase):
99
99
 
 
100
    def setUp(self):
 
101
        super(TestInstall, self).setUp()
 
102
        # Restore a proper env to test translation installation
 
103
        self.overrideAttr(i18n, 'installed', self.i18nInstalled)
 
104
        self.overrideAttr(i18n, '_translations', None)
 
105
 
100
106
    def test_custom_languages(self):
101
 
        self.overrideAttr(i18n, '_translations', None)
102
107
        self.enableI18n()
103
108
        i18n.install('nl:fy')
104
109
        self.assertIsInstance(i18n._translations, i18n._gettext.NullTranslations)
105
110
 
106
111
    def test_no_env_variables(self):
107
 
        self.overrideAttr(i18n, '_translations', None)
108
 
        self.enableI18n()
109
112
        self.overrideEnv('LANGUAGE', None)
110
113
        self.overrideEnv('LC_ALL', None)
111
114
        self.overrideEnv('LC_MESSAGES', None)
114
117
        self.assertIsInstance(i18n._translations, i18n._gettext.NullTranslations)
115
118
 
116
119
    def test_disable_i18n(self):
117
 
        self.overrideAttr(i18n, '_translations', None)
118
120
        i18n.disable_i18n()
119
121
        i18n.install()
120
122
        self.assertTrue(i18n._translations is None)