diff options
author | Doug Hellmann <doug.hellmann@dreamhost.com> | 2014-04-29 12:45:01 -0700 |
---|---|---|
committer | Doug Hellmann <doug.hellmann@dreamhost.com> | 2014-04-29 12:45:01 -0700 |
commit | 291e381a9cf78c0d23d2c6606455b2edf3c959a0 (patch) | |
tree | fd4760b822f16b78f9db4ce8b46997e9a53cac89 | |
parent | 3344513ec7cad359957c1cc3f1608aa0c3d18d8b (diff) | |
download | oslo-i18n-291e381a9cf78c0d23d2c6606455b2edf3c959a0.tar.gz |
update tests for python 3
Change-Id: I8b5f31fcee83fb3d33d2b144c91376ae47bb78b8
-rw-r--r-- | tests/test_gettextutils.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/test_gettextutils.py b/tests/test_gettextutils.py index f7ebc46..db26fc8 100644 --- a/tests/test_gettextutils.py +++ b/tests/test_gettextutils.py @@ -757,18 +757,24 @@ class TranslatorFactoryTest(test_base.BaseTestCase): class LogLevelTranslationsTest(test_base.BaseTestCase): - scenarios = [ - (level, {'level': level}) - for level in - ['info', 'warning', 'error', 'critical'] - ] + def test_info(self): + self._test('info') - def test(self): + def test_warning(self): + self._test('warning') + + def test_error(self): + self._test('error') + + def test_critical(self): + self._test('critical') + + def _test(self, level): with mock.patch.object(gettextutils.TranslatorFactory, '_make_translation_func') as mtf: tf = gettextutils.TranslatorFactory('domain', lazy=False) - getattr(tf, 'log_%s' % self.level) - mtf.assert_called_with('domain-log-%s' % self.level) + getattr(tf, 'log_%s' % level) + mtf.assert_called_with('domain-log-%s' % level) class SomeObject(object): |