#NEWLINE# @ httpretty . activate #NEWLINE# def test_get_all_bad_status( self ) : #NEWLINE# #INDENT# 'Test how we handle _get_all getting a bad status code' #NEWLINE# error = json . dumps ( { #NEWLINE# #INDENT# 'error' : 'error' , #NEWLINE# #UNINDENT# } ) #NEWLINE# test_url = '{url}repos/{org}/{repo}/hooks' . format ( url = self . URL , org = self . ORG , repo = self . TEST_REPO ) #NEWLINE# self . register_hook_list ( body = error , status = 422 ) #NEWLINE# git_hub = GitHub ( self . URL , self . OAUTH2_TOKEN ) #NEWLINE# with self . assertRaisesRegexp ( GitHubUnknownError , re . escape ( error ) ) : #NEWLINE# #INDENT# git_hub . _get_all ( test_url )