#NEWLINE# def test_get_var_completion_list( self ) : #NEWLINE# #INDENT# vars_in_completion = [ '${/}' , '${:}' , '${\\n}' , '${DEBUG_FILE}' , '${EMPTY}' , '${EXECDIR}' , '${False}' , '${LOG_FILE}' , '${LOG_LEVEL}' , '${None}' , '${null}' , '${OUTPUT_DIR}' , '${OUTPUT_FILE}' , '${PREV_TEST_MESSAGE}' , '${PREV_TEST_NAME}' , '${PREV_TEST_STATUS}' , '${REPORT_FILE}' , '${SPACE}' , '${SUITE_DOCUMENTATION}' , '${SUITE_NAME}' , '${SUITE_SOURCE}' , '${TEMPDIR}' , '${TEST_DOCUMENTATION}' , '${TEST_NAME}' , '${True}' , '${TEST_A}' , '${COMMON_VARIABLE_1}' , '${COMMON_VARIABLE_2}' , '${RESOURCE_A}' ] #NEWLINE# var_l = [ ] #NEWLINE# for var in vars_in_completion : #NEWLINE# #INDENT# if var . startswith ( '$' ) : #NEWLINE# #INDENT# var_l . append ( ( var , var [ 1 : ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# var_l . append ( ( var , var ) ) #NEWLINE# #UNINDENT# #UNINDENT# result = get_var_completion_list ( self . test_a_index , '$' , '' ) #NEWLINE# result = sorted ( result , key = ( lambda v : v [ 0 ] ) ) #NEWLINE# var_l = sorted ( var_l , key = ( lambda v : v [ 0 ] ) ) #NEWLINE# for ( e , r ) in zip ( result , var_l ) : #NEWLINE# #INDENT# self . assertEqual ( r , e ) #NEWLINE# #UNINDENT# self . assertEqual ( len ( result ) , len ( var_l ) ) #NEWLINE# result = get_var_completion_list ( self . test_a_index , '${RESO' , '' ) #NEWLINE# self . assertEqual ( result , [ ( '${RESOURCE_A}' , 'RESOURCE_A}' ) ] ) #NEWLINE# result = get_var_completion_list ( self . test_a_index , '${reso' , '' ) #NEWLINE# self . assertEqual ( result , [ ( '${RESOURCE_A}' , 'RESOURCE_A}' ) ] ) #NEWLINE# result = get_var_completion_list ( self . test_a_index , '@' , '' ) #NEWLINE# self . assertEqual ( result , [ ( '@{EMPTY}' , '{EMPTY}' ) , ( '@{TEST_TAGS}' , '{TEST_TAGS}' ) ] ) #NEWLINE# result = get_var_completion_list ( self . test_a_index , '&' , '' ) #NEWLINE# self . assertEqual ( result , [ ( '&{EMPTY}' , '{EMPTY}' ) , ( '&{SUITE_METADATA}' , '{SUITE_METADATA}' ) ] ) #NEWLINE# result = get_var_completion_list ( self . test_a_index , '${NOT_HERE' , '' ) #NEWLINE# self . assertEqual ( result , [ ] )