#NEWLINE# def test_register_hook( ) : #NEWLINE# #INDENT# repo = Mock ( spec = github3 . repos . repo . Repository , full_name = 'mark/lint-review' ) #NEWLINE# repo . hooks . return_value = [ ] #NEWLINE# url = 'http://example.com/review/start' #NEWLINE# github . register_hook ( repo , url ) #NEWLINE# assert repo . create_hook . called , 'Create not called' #NEWLINE# calls = repo . create_hook . call_args_list #NEWLINE# expected = call ( name = 'web' , active = True , config = { #NEWLINE# #INDENT# 'content_type' : 'json' , #NEWLINE# 'url' : url , #NEWLINE# #UNINDENT# } , events = [ 'pull_request' ] ) #NEWLINE# eq_ ( calls [ 0 ] , url )