#NEWLINE# def TestHookFailed( ) : #NEWLINE# #INDENT# "Checks whether the global hooks have been executed (status error).\n\n  - Global post hook should with status *error* should has been executed.\n  - Global post hook with other statuses shouldn't have been executed.\n  " #NEWLINE# master = GetMasterNode ( ) . primary #NEWLINE# job_id = ExecuteJobProducingCommand ( 'gnt-debug delay --submit 0' ) #NEWLINE# time . sleep ( 1 ) #NEWLINE# AssertEqual ( IsFileExists ( master , _GetHookFilePath ( job_id , 'post' , constants . POST_HOOKS_STATUS_SUCCESS ) ) , False , 'Global post hook has been executed with status *success*' ) #NEWLINE# AssertEqual ( IsFileExists ( master , _GetHookFilePath ( job_id , 'post' , constants . POST_HOOKS_STATUS_ERROR ) ) , True , "Global post hook hasn't been executed with status *error*" ) #NEWLINE# AssertEqual ( IsFileExists ( master , _GetHookFilePath ( master , 'post' , constants . POST_HOOKS_STATUS_DISAPPEARED ) ) , False , 'Global post hook has been executed with status *disappeared*' )