#NEWLINE# def test_register_hook_already_registered( self ) : #NEWLINE# #INDENT# 'Testing hook registration with already registered callback' #NEWLINE# hook = APIExtraDataAccessHook ( self . extension , self . resource , [ ( ( 'public' , ) , ExtraDataAccessLevel . ACCESS_STATE_PUBLIC ) ] ) #NEWLINE# with self . assertRaises ( AlreadyRegisteredError ) : #NEWLINE# #INDENT# hook . resource . extra_data_access_callbacks . register ( hook . get_extra_data_state ) #NEWLINE# #UNINDENT# self . assertNotEqual ( set ( ) , set ( hook . resource . extra_data_access_callbacks ) )