

def test_command_arguments_and_sub_command(self):
    child = commands.Command()
    child.add_argument('--baz')
    cmd = commands.Command()
    cmd.add_argument('--bar')
    cmd.add_child('foo', child)
    result = cmd.parse(['--bar', 'baz', 'foo'])
    self.assertEqual(result.bar, 'baz')
    self.assertEqual(result.baz, None)

dataset/ETHPy150Open mopidy/mopidy/tests/test_commands.py CommandParsingTest.test_command_arguments_and_sub_command/original