<s> """<STR_LIT>""" <EOL> import TestGyp <EOL> import sys <EOL> from xml . dom . minidom import parseString <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> import pywintypes <EOL> import win32api <EOL> import winerror <EOL> RT_MANIFEST = <NUM_LIT> <EOL> class LoadLibrary ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , path ) : <EOL> self . _path = path <EOL> self . _handle = None <EOL> def __enter__ ( self ) : <EOL> self . _handle = win32api . LoadLibrary ( self . _path ) <EOL> return self . _handle <EOL> def __exit__ ( self , type , value , traceback ) : <EOL> win32api . FreeLibrary ( self . _handle ) <EOL> def extract_manifest ( path , resource_name ) : <EOL> """<STR_LIT>""" <EOL> with LoadLibrary ( path ) as handle : <EOL> try : <EOL> return win32api . LoadResource ( handle , RT_MANIFEST , resource_name ) <EOL> except pywintypes . error as error : <EOL> if error . args [ <NUM_LIT:0> ] == winerror . ERROR_RESOURCE_DATA_NOT_FOUND : <EOL> return None <EOL> else : <EOL> raise <EOL> test = TestGyp . TestGyp ( formats = [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> CHDIR = '<STR_LIT>' <EOL> test . run_gyp ( '<STR_LIT>' , chdir = CHDIR ) <EOL> test . build ( '<STR_LIT>' , test . ALL , chdir = CHDIR ) <EOL> test . fail_test ( not extract_manifest ( test . built_file_path ( <EOL> '<STR_LIT>' , chdir = CHDIR ) , <NUM_LIT:1> ) ) <EOL> test . fail_test ( not extract_manifest ( test . built_file_path ( <EOL> '<STR_LIT>' , chdir = CHDIR ) , <NUM_LIT:1> ) ) <EOL> test . fail_test ( not extract_manifest ( test . built_file_path ( <EOL> '<STR_LIT>' , chdir = CHDIR ) , <NUM_LIT:1> ) ) <EOL> manifest = parseString ( extract_manifest ( <EOL> test . built_file_path ( '<STR_LIT>' , chdir = CHDIR ) , <NUM_LIT:1> ) ) <EOL> execution_level = manifest . getElementsByTagName ( '<STR_LIT>' ) <EOL> test . fail_test ( len ( execution_level ) != <NUM_LIT:1> ) <EOL> execution_level = execution_level [ <NUM_LIT:0> ] . attributes <EOL> test . fail_test ( not ( <EOL> execution_level . has_key ( '<STR_LIT>' ) and <EOL> execution_level . has_key ( '<STR_LIT>' ) and <EOL> execution_level [ '<STR_LIT>' ] . nodeValue == '<STR_LIT>' and <EOL> execution_level [ '<STR_LIT>' ] . nodeValue == '<STR_LIT:false>' ) ) <EOL> manifest = parseString ( extract_manifest ( <EOL> test . built_file_path ( '<STR_LIT>' , chdir = CHDIR ) , <NUM_LIT:1> ) ) <EOL> execution_level = manifest . getElementsByTagName ( '<STR_LIT>' ) <EOL> test . fail_test ( len ( execution_level ) != <NUM_LIT:0> ) <EOL> manifest = parseString ( extract_manifest ( <EOL> test . built_file_path ( '<STR_LIT>' , chdir = CHDIR ) , <NUM_LIT:1> ) ) <EOL> execution_level = manifest . getElementsByTagName ( '<STR_LIT>' ) <EOL> test . fail_test ( len ( execution_level ) != <NUM_LIT:1> ) <EOL> execution_level = execution_level [ <NUM_LIT:0> ] . attributes <EOL> test . fail_test ( not ( <EOL> execution_level . has_key ( '<STR_LIT>' ) and <EOL> execution_level . has_key ( '<STR_LIT>' ) and <EOL> execution_level [ '<STR_LIT>' ] . nodeValue == '<STR_LIT>' and <EOL> execution_level [ '<STR_LIT>' ] . nodeValue == '<STR_LIT:true>' ) ) <EOL> test . pass_test ( ) </s>
