/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_i18n.py

Support user.signingkey configuration variable in .git/config.

Merged from https://code.launchpad.net/~jelmer/brz/local-git-key/+merge/381000

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    errors,
25
25
    workingtree,
26
26
    )
 
27
from ..sixish import PY3
27
28
 
28
29
 
29
30
class ZzzTranslations(object):
62
63
        t = trans.zzz('msg')
63
64
        self._check_exact(u'zz\xe5{{msg}}', t)
64
65
 
65
 
        t = trans.gettext('msg')
66
 
        self._check_exact(u'zz\xe5{{msg}}', t)
67
 
 
68
 
        t = trans.ngettext('msg1', 'msg2', 0)
69
 
        self._check_exact(u'zz\xe5{{msg2}}', t)
70
 
        t = trans.ngettext('msg1', 'msg2', 2)
71
 
        self._check_exact(u'zz\xe5{{msg2}}', t)
72
 
 
73
 
        t = trans.ngettext('msg1', 'msg2', 1)
74
 
        self._check_exact(u'zz\xe5{{msg1}}', t)
 
66
        if PY3:
 
67
            t = trans.gettext('msg')
 
68
            self._check_exact(u'zz\xe5{{msg}}', t)
 
69
 
 
70
            t = trans.ngettext('msg1', 'msg2', 0)
 
71
            self._check_exact(u'zz\xe5{{msg2}}', t)
 
72
            t = trans.ngettext('msg1', 'msg2', 2)
 
73
            self._check_exact(u'zz\xe5{{msg2}}', t)
 
74
 
 
75
            t = trans.ngettext('msg1', 'msg2', 1)
 
76
            self._check_exact(u'zz\xe5{{msg1}}', t)
 
77
        else:
 
78
            t = trans.ugettext('msg')
 
79
            self._check_exact(u'zz\xe5{{msg}}', t)
 
80
 
 
81
            t = trans.ungettext('msg1', 'msg2', 0)
 
82
            self._check_exact(u'zz\xe5{{msg2}}', t)
 
83
            t = trans.ungettext('msg1', 'msg2', 2)
 
84
            self._check_exact(u'zz\xe5{{msg2}}', t)
 
85
 
 
86
            t = trans.ungettext('msg1', 'msg2', 1)
 
87
            self._check_exact(u'zz\xe5{{msg1}}', t)
75
88
 
76
89
 
77
90
class TestGetText(tests.TestCase):
151
164
            workingtree.WorkingTree.open('./foo')
152
165
        except errors.NotBranchError as e:
153
166
            err = str(e)
154
 
        self.assertContainsRe(err, u"zz\xe5{{Not a branch: .*}}")
 
167
        if PY3:
 
168
            self.assertContainsRe(err, u"zz\xe5{{Not a branch: .*}}")
 
169
        else:
 
170
            self.assertContainsRe(
 
171
                err, u"zz\xe5{{Not a branch: .*}}".encode('utf-8'))
155
172
 
156
173
    def test_topic_help_translation(self):
157
174
        """does topic help get translated?"""