mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-14 00:21:08 +00:00
Encode the developer name in the current locale to run the test; thanks
Stefano Rivera.
This commit is contained in:
parent
a41422a7f4
commit
658946c214
@ -18,6 +18,7 @@
|
||||
import __builtin__
|
||||
import os
|
||||
import sys
|
||||
import locale
|
||||
from StringIO import StringIO
|
||||
|
||||
import mox
|
||||
@ -213,6 +214,10 @@ class UbuEmailTestCase(unittest.TestCase):
|
||||
self.assertEqual(os.environ['DEBEMAIL'], orig)
|
||||
|
||||
def test_unicode_name(self):
|
||||
os.environ['DEBFULLNAME'] = name = 'Jöe Déveloper'
|
||||
encoding = locale.getdefaultlocale()[1]
|
||||
if not encoding:
|
||||
encoding = 'utf-8'
|
||||
name = 'Jöe Déveloper'.decode('utf-8')
|
||||
os.environ['DEBFULLNAME'] = name.encode(encoding)
|
||||
os.environ['DEBEMAIL'] = email = 'joe@example.net'
|
||||
self.assertEqual(ubu_email(), (name.decode('utf-8'), email))
|
||||
self.assertEqual(ubu_email(), (name, email))
|
||||
|
Loading…
x
Reference in New Issue
Block a user