<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import json <EOL> import os <EOL> from google . apputils import basetest <EOL> from googleapis . codegen import generator_lookup <EOL> from googleapis . codegen import java_generator <EOL> from googleapis . codegen import targets <EOL> class GeneratorLookupTest ( basetest . TestCase ) : <EOL> def testDetermineGenerator ( self ) : <EOL> test_gen = generator_lookup . GetGeneratorByLanguage ( '<STR_LIT>' ) <EOL> self . assertEqual ( java_generator . Java14Generator , test_gen ) <EOL> self . assertRaises ( <EOL> ValueError , generator_lookup . GetGeneratorByLanguage , <EOL> '<STR_LIT>' ) <EOL> def testSupportedLanguage ( self ) : <EOL> languages = generator_lookup . SupportedLanguages ( ) <EOL> self . assertContainsSubset ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , languages ) <EOL> self . assertNotIn ( '<STR_LIT>' , languages ) <EOL> def testVersion ( self ) : <EOL> gen = generator_lookup . GetGeneratorByLanguage ( '<STR_LIT>' ) <EOL> self . assertEquals ( java_generator . Java12Generator , gen ) <EOL> gen = generator_lookup . GetGeneratorByLanguage ( '<STR_LIT>' ) <EOL> self . assertEquals ( java_generator . Java12Generator , gen ) <EOL> gen = generator_lookup . GetGeneratorByLanguage ( '<STR_LIT>' ) <EOL> self . assertEquals ( java_generator . Java14Generator , gen ) <EOL> def testVersionFromFeature ( self ) : <EOL> template_root = os . path . join ( os . path . dirname ( __file__ ) , <EOL> '<STR_LIT>' ) <EOL> targets . Targets . SetDefaultTemplateRoot ( template_root ) <EOL> features_path = os . path . join ( template_root , <EOL> '<STR_LIT>' ) <EOL> raw_features = json . load ( open ( features_path ) ) <EOL> generator_name = raw_features [ '<STR_LIT>' ] <EOL> gen = generator_lookup . GetGeneratorByLanguage ( generator_name ) <EOL> self . assertEquals ( java_generator . Java12Generator , gen ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> basetest . main ( ) </s>
