def test_unicode_script():
 s = unicode('import datetime; datetime.timedelta')
 completions = Script(s).completions()
 assert len(completions)
 assert (type(completions[0].description) is unicode)
 s = u("author='\xc3\xb6\xc3\xa4'; author")
 completions = Script(s).completions()
 x = completions[0].description
 assert (type(x) is unicode)
 s = u("#-*- coding: iso-8859-1 -*-\nauthor='\xc3\xb6\xc3\xa4'; author")
 s = s.encode('latin-1')
 completions = Script(s).completions()
 assert (type(completions[0].description) is unicode)

def test_unicode_script ( ) : s = unicode ( 'import datetime; datetime.timedelta' ) completions = Script ( s ) . completions ( ) assert len ( completions ) assert ( type ( completions [ 0 ] . description ) is unicode ) s = u ( "author='\xc3\xb6\xc3\xa4'; author" ) completions = Script ( s ) . completions ( ) x = completions [ 0 ] . description assert ( type ( x ) is unicode ) s = u ( "#-*- coding: iso-8859-1 -*-\nauthor='\xc3\xb6\xc3\xa4'; author" ) s = s . encode ( 'latin-1' ) completions = Script ( s ) . completions ( ) assert ( type ( completions [ 0 ] . description ) is unicode )
normally no unicode objects are being used .