#NEWLINE# def test_suggested_column_names_from_visible_table( completer , complete_event ) : #NEWLINE# #INDENT# '\n    Suggest column and function names when selecting from table\n    :param completer:\n    :param complete_event:\n    :return:\n    ' #NEWLINE# text = 'SELECT  from users' #NEWLINE# position = len ( 'SELECT ' ) #NEWLINE# result = set ( completer . get_completions ( Document ( text = text , cursor_position = position ) , complete_event ) ) #NEWLINE# assert ( set ( result ) == set ( ( ( [ Completion ( text = '*' , start_position = 0 , display_meta = 'column' ) , Completion ( text = 'id' , start_position = 0 , display_meta = 'column' ) , Completion ( text = 'email' , start_position = 0 , display_meta = 'column' ) , Completion ( text = 'first_name' , start_position = 0 , display_meta = 'column' ) , Completion ( text = 'last_name' , start_position = 0 , display_meta = 'column' ) , Completion ( text = 'custom_func1' , start_position = 0 , display_meta = 'function' ) , Completion ( text = 'custom_func2' , start_position = 0 , display_meta = 'function' ) , Completion ( text = 'set_returning_func' , start_position = 0 , display_meta = 'function' ) ] + list ( map ( ( lambda f : Completion ( f , display_meta = 'function' ) ) , completer . functions ) ) ) + list ( map ( ( lambda x : Completion ( x , display_meta = 'keyword' ) ) , completer . keywords ) ) ) ) )