

def test_nested_subcommands_with_options(self):
    subchild = commands.Command()
    subchild.add_argument('--test', help='the great and wonderful')
    child = commands.Command()
    child.add_child('baz', subchild)
    child.add_argument('-h', '--help', action='store_true', help='show this message')
    cmd = commands.Command()
    cmd.add_child('bar', child)
    expected = 'usage: foo\n\nCOMMANDS:\n\nbar [-h]\n\n    -h, --help  show this message\n\nbar baz [--test TEST]\n\n    --test TEST  the great and wonderful'
    self.assertEqual(expected, cmd.format_help('foo').strip())

dataset/ETHPy150Open mopidy/mopidy/tests/test_commands.py HelpTest.test_nested_subcommands_with_options/original