def test__generic_log(self):
        """
        Tests generic logger setup, make sure format and leves are set etc
        """
        logger = "syslog"
        mock_handler = mock.Mock()
        format_string = "nonsense"
        level = "debug?"

        mock_get_logger = mock.Mock()
        self.mock_logger.getLogger.return_value = mock_get_logger

        result = utils.generic_logging(
            logger,
            mock_handler,
            format_string,
            level
        )
        self.mock_logger.getLogger.assert_called_once_with(logger)
        mock_get_logger.setLevel.assert_called_once_with(level)
        self.mock_logger.Formatter.assert_called_once_with(format_string)
        mock_handler.setLevel.assert_called_once_with(level)
        mock_handler.setFormatter.assert_called_once_with(mock.ANY)
        mock_get_logger.addHandler.assert_called_once_with(mock_handler)

        assert result == mock_get_logger
    def test__generic_log__tuple_format(self):
        """
        Tests generic logger setup, where the
        format is passed in as tuple
        """
        logger = "syslog"
        mock_handler = mock.Mock()
        format_string = ("more", "nonsense")
        level = "debug?"

        mock_get_logger = mock.Mock()
        self.mock_logger.getLogger.return_value = mock_get_logger

        utils.generic_logging(
            logger,
            mock_handler,
            format_string,
            level
        )

        self.mock_logger.Formatter.assert_called_once_with(
            format_string[0],
            format_string[1]
        )