#NEWLINE# def test_language_packs_post_longname( self , LanguagePackHandler , resp_mock , request_mock ) : #NEWLINE# #INDENT# json_create = { #NEWLINE# #INDENT# 'name' : ( 'a' * 101 ) , #NEWLINE# 'source_uri' : 'git@github.com/sample/a.git' , #NEWLINE# 'lp_metadata' : 'some metadata' , #NEWLINE# #UNINDENT# } #NEWLINE# request_mock . body = json . dumps ( LanguagePackHandler ) #NEWLINE# request_mock . content_type = 'application/json' #NEWLINE# hand_create = LanguagePackHandler . return_value . create #NEWLINE# hand_create . return_value = fakes . FakeImage ( ) #NEWLINE# ret_val = language_pack . LanguagePacksController ( ) . post ( ) #NEWLINE# faultstring = str ( ret_val [ 'faultstring' ] ) #NEWLINE# error_msg = 'Names must not be longer than 100 characters' #NEWLINE# self . assertTrue ( faultstring . endswith ( error_msg ) ) #NEWLINE# self . assertEqual ( 400 , resp_mock . status )