#NEWLINE# @ pytest . mark . parametrize ( 'text' , [ 'SELECT 1::' , 'CREATE TABLE foo (bar ' , 'CREATE FUNCTION foo (bar INT, baz ' , 'ALTER TABLE foo ALTER COLUMN bar TYPE ' ] ) #NEWLINE# def test_suggest_datatype( text , completer , complete_event ) : #NEWLINE# #INDENT# pos = len ( pos ) #NEWLINE# result = completer . get_completions ( Document ( text = text , cursor_position = pos ) , complete_event ) #NEWLINE# assert ( set ( result ) == set ( ( [ Completion ( text = 'custom_type1' , start_position = 0 , display_meta = 'datatype' ) , Completion ( text = 'custom_type2' , start_position = 0 , display_meta = 'datatype' ) , Completion ( text = 'public' , start_position = 0 , display_meta = 'schema' ) , Completion ( text = 'users' , start_position = 0 , display_meta = 'table' ) , Completion ( text = 'orders' , start_position = 0 , display_meta = 'table' ) , Completion ( text = '"select"' , start_position = 0 , display_meta = 'table' ) ] + list ( map ( ( lambda f : Completion ( f , display_meta = 'datatype' ) ) , completer . datatypes ) ) ) ) )