def test_logLevelInvalid(self):
        """
        L{TwistOptions.opt_log_level} with an invalid log level name raises
        UsageError.
        """
        options = TwistOptions()

        self.assertRaises(UsageError, options.opt_log_level, "cheese")

        L{TwistOptions.opt_log_level} with an invalid log level name raises
        UsageError.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/twist/test/test_options.py