#NEWLINE# @ httpretty . activate #NEWLINE# def test_create_hook( self ) : #NEWLINE# #INDENT# 'Test valid hook creation' #NEWLINE# self . register_hook_create ( json . dumps ( { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# #UNINDENT# } ) , status = 201 ) #NEWLINE# git_hub = GitHub ( self . URL , self . OAUTH2_TOKEN ) #NEWLINE# git_hub . add_web_hook ( self . ORG , self . TEST_REPO , 'http://fluff' ) #NEWLINE# error_body = json . dumps ( { #NEWLINE# #INDENT# 'message' : 'Validation Failed' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . register_hook_create ( body = error_body , status = 422 ) #NEWLINE# with self . assertRaisesRegexp ( GitHubUnknownError , error_body ) : #NEWLINE# #INDENT# git_hub . add_web_hook ( self . ORG , self . TEST_REPO , 'http://fluff' )