def test_dict_key_completion_unicode_py3():
 ip = get_ipython()
 complete = ip.Completer.complete
 ip.user_ns['d'] = {u'a\u05d0': None}
 if (sys.platform != 'win32'):
  (_, matches) = complete(line_buffer="d['a\\u05d0")
  nt.assert_in('u05d0', matches)
 (_, matches) = complete(line_buffer="d['a\\u05d0")
 nt.assert_in(u'a\u05d0', matches)
 with greedy_completion():
  (_, matches) = complete(line_buffer="d['a\\u05d0")
  nt.assert_in("d['a\\u05d0']", matches)
  (_, matches) = complete(line_buffer="d['a\\u05d0")
  nt.assert_in(u"d['a\u05d0']", matches)

def test_dict_key_completion_unicode_py3 ( ) : ip = get_ipython ( ) complete = ip . Completer . complete ip . user_ns [ 'd' ] = { u'a\u05d0' : None } if ( sys . platform != 'win32' ) : ( _ , matches ) = complete ( line_buffer = "d['a\\u05d0" ) nt . assert_in ( 'u05d0' , matches ) ( _ , matches ) = complete ( line_buffer = "d['a\\u05d0" ) nt . assert_in ( u'a\u05d0' , matches ) with greedy_completion ( ) : ( _ , matches ) = complete ( line_buffer = "d['a\\u05d0" ) nt . assert_in ( "d['a\\u05d0']" , matches ) ( _ , matches ) = complete ( line_buffer = "d['a\\u05d0" ) nt . assert_in ( u"d['a\u05d0']" , matches )
test handling of unicode in dict key completion .