

def test_invalid_subcommand(self):
    cmd = commands.Command()
    cmd.add_child('baz', commands.Command())
    with self.assertRaises(SystemExit):
        cmd.parse(['bar'], prog='foo')
    self.exit_mock.assert_called_once_with(1, 'unrecognized command: bar', 'usage: foo')

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