def test_process_message_fails_due_to_invalid_check_sent_from_server(self): check_manager = CheckManager(self.platform_setup, Mock(), Mock()) check_manager._logger = Mock() check_manager._process_message(Message.TYPE['CHECK'], [{}]) # TODO: Fix to assert a CheckError instance is passed to 'log'. Why does this fail ? # check_manager._logger.log.assert_called_with(CheckError('Error - Server sent empty or invalid check.')) check_manager._logger.log.assert_called_with(ANY)
def test_build_checks_raises_check_error(self): check_manager = CheckManager(self.platform_setup, Mock(), Mock()) check_manager._build_checks([{}])
def test_process_message_fails_due_to_invalid_message_type(self): check_manager = CheckManager(self.platform_setup, Mock(), Mock()) check_manager._logger = Mock() check_manager._process_message(max(Message.TYPE.values()) + 1, [{}]) check_manager._logger.log.assert_called_with(ANY)