~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:31:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6139.
  • Revision ID: jriddell@canonical.com-20110914163157-ee87lu1pqmq5b4r3
default _translations back to None so we can tell if it gets installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
class TestInstall(tests.TestCase):
99
99
 
100
100
    def test_custom_languages(self):
101
 
        self.overrideAttr(i18n, '_translations', i18n._gettext.NullTranslations())
 
101
        self.overrideAttr(i18n, '_translations', None)
102
102
        self.enableI18n()
103
103
        i18n.install('nl:fy')
104
104
        self.assertIsInstance(i18n._translations, i18n._gettext.NullTranslations)
105
105
 
106
106
    def test_no_env_variables(self):
107
 
        self.overrideAttr(i18n, '_translations', i18n._gettext.NullTranslations())
 
107
        self.overrideAttr(i18n, '_translations', None)
108
108
        self.enableI18n()
109
109
        self.overrideEnv('LANGUAGE', None)
110
110
        self.overrideEnv('LC_ALL', None)
114
114
        self.assertIsInstance(i18n._translations, i18n._gettext.NullTranslations)
115
115
 
116
116
    def test_disable_i18n(self):
 
117
        self.overrideAttr(i18n, '_translations', None)
117
118
        i18n.disable_i18n()
118
119
        i18n.install()
119
 
        self.assertTrue(isinstance(i18n._translations, i18n._gettext.NullTranslations))
 
120
        self.assertTrue(i18n._translations is None)
 
121
 
120
122
 
121
123
class TestTranslate(tests.TestCaseWithTransport):
122
124