

def test_help_action_works(self):
    cmd = commands.Command()
    cmd.add_argument('-h', action='help')
    cmd.format_help = mock.Mock()
    with self.assertRaises(SystemExit):
        cmd.parse(['-h'])
    self.format_help.assert_called_once_with(mock.ANY)
    self.exit_mock.assert_called_once_with(0, cmd.format_help.return_value)

dataset/ETHPy150Open mopidy/mopidy/tests/test_commands.py CommandParsingTest.test_help_action_works/VarMisuse@59/74 `cmd`->`self`