def test_dict_key_completion_invalids():
 ip = get_ipython()
 complete = ip.Completer.complete
 ip.user_ns['no_getitem'] = None
 ip.user_ns['no_keys'] = []
 ip.user_ns['cant_call_keys'] = dict
 ip.user_ns['empty'] = {}
 ip.user_ns['d'] = {'abc': 5}
 (_, matches) = complete(line_buffer="no_getitem['")
 (_, matches) = complete(line_buffer="no_keys['")
 (_, matches) = complete(line_buffer="cant_call_keys['")
 (_, matches) = complete(line_buffer="empty['")
 (_, matches) = complete(line_buffer="name_error['")
 (_, matches) = complete(line_buffer="d['\\")

def test_dict_key_completion_invalids ( ) : ip = get_ipython ( ) complete = ip . Completer . complete ip . user_ns [ 'no_getitem' ] = None ip . user_ns [ 'no_keys' ] = [ ] ip . user_ns [ 'cant_call_keys' ] = dict ip . user_ns [ 'empty' ] = { } ip . user_ns [ 'd' ] = { 'abc' : 5 } ( _ , matches ) = complete ( line_buffer = "no_getitem['" ) ( _ , matches ) = complete ( line_buffer = "no_keys['" ) ( _ , matches ) = complete ( line_buffer = "cant_call_keys['" ) ( _ , matches ) = complete ( line_buffer = "empty['" ) ( _ , matches ) = complete ( line_buffer = "name_error['" ) ( _ , matches ) = complete ( line_buffer = "d['\\" )
smoke test cases dict key completion cant handle .