def test_usageConsistencyOnError(self):
        """
        The example script prints a usage message to stderr if it is
        passed unrecognized command line arguments.

        The first line should contain a USAGE summary, explaining the
        accepted command arguments.

        The last line should contain an ERROR summary, explaining that
        incorrect arguments were supplied.
        """
        # Pass None as first parameter - the reactor - it shouldn't
        # get as far as calling it.
        self.assertRaises(
            SystemExit, self.example.main, None, '--unexpected_argument')

        err = self.fakeErr.getvalue().splitlines()
        self.assertTrue(
            err[0].startswith('Usage:'),
            'Usage message first line should start with "Usage:". '
            'Actual: %r' % (err[0],))
        self.assertTrue(
            err[-1].startswith('ERROR:'),
            'Usage message last line should start with "ERROR:" '
            'Actual: %r' % (err[-1],))

        The example script prints a usage message to stderr if it is
        passed unrecognized command line arguments.

        The first line should contain a USAGE summary, explaining the
        accepted command arguments.

        The last line should contain an ERROR summary, explaining that
        incorrect arguments were supplied.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_examples.py