def test_command_version():
    class VersionCommandLine(Application):

        @command(description='test', prog='Basic')
        @param('--force', action='store_true', dest='force1')
        @param('--force2', action='store', dest='force2')
        @version('--version', version='%(prog)s 1.0')
        def main(self, params):
            assert params.force1 == eval(params.force2)
            self._main()

        def _main(self):
            pass

    with patch.object(VersionCommandLine, '_main') as _main:
        c = VersionCommandLine()
        exception = False
        try:
            c.parse(['--version'])
            assert False
        except __HOLE__:
            exception = True
        assert exception
        assert not _main.called
dataset/ETHPy150Open hyde/commando/commando/tests/test_commando.py/test_command_version