# Path: ceph_deploy/cli.py
# def get_parser():
#     epilog_text = "See 'ceph-deploy <command> --help' for help on a specific command"
#     parser = argparse.ArgumentParser(
#         prog='ceph-deploy',
#         formatter_class=argparse.RawDescriptionHelpFormatter,
#         description='Easy Ceph deployment\n\n%s' % __header__,
#         epilog=epilog_text
#         )
#     verbosity = parser.add_mutually_exclusive_group(required=False)
#     verbosity.add_argument(
#         '-v', '--verbose',
#         action='store_true', dest='verbose', default=False,
#         help='be more verbose',
#         )
#     verbosity.add_argument(
#         '-q', '--quiet',
#         action='store_true', dest='quiet',
#         help='be less verbose',
#         )
#     parser.add_argument(
#         '--version',
#         action='version',
#         version='%s' % ceph_deploy.__version__,
#         help='the current installed version of ceph-deploy',
#         )
#     parser.add_argument(
#         '--username',
#         help='the username to connect to the remote host',
#         )
#     parser.add_argument(
#         '--overwrite-conf',
#         action='store_true',
#         help='overwrite an existing conf file on remote host (if present)',
#         )
#     parser.add_argument(
#         '--ceph-conf',
#         dest='ceph_conf',
#         help='use (or reuse) a given ceph.conf file',
#     )
#     sub = parser.add_subparsers(
#         title='commands',
#         metavar='COMMAND',
#         help='description',
#         )
#     sub.required = True
#     entry_points = [
#         (ep.name, ep.load())
#         for ep in pkg_resources.iter_entry_points('ceph_deploy.cli')
#         ]
#     entry_points.sort(
#         key=lambda name_fn: getattr(name_fn[1], 'priority', 100),
#         )
#     for (name, fn) in entry_points:
#         p = sub.add_parser(
#             name,
#             description=fn.__doc__,
#             help=fn.__doc__,
#             )
#         if not os.environ.get('CEPH_DEPLOY_TEST'):
#             p.set_defaults(cd_conf=ceph_deploy.conf.cephdeploy.load())
# 
#         # flag if the default release is being used
#         p.set_defaults(default_release=False)
#         fn(p)
#         p.required = True
#     parser.set_defaults(
#         cluster='ceph',
#         )
# 
#     return parser
# 
# Path: ceph_deploy/tests/util.py
# def assert_too_few_arguments(err):
#     assert ("error: too few arguments" in err or
#             "error: the following argument" in err)


import pytest
from ceph_deploy.cli import get_parser
from ceph_deploy.tests.util import assert_too_few_arguments
        with pytest.raises(SystemExit):
            self.parser.parse_args('disk list'.split())
        out, err = capsys.readouterr()
        assert_too_few_arguments(err)

    def test_disk_list_single_host(self):
        args = self.parser.parse_args('disk list host1'.split())
        assert args.host[0] == 'host1'
        assert args.debug is False

    def test_disk_list_single_host_debug(self):
        args = self.parser.parse_args('disk list --debug host1'.split())
        assert args.host[0] == 'host1'
        assert args.debug is True

    def test_disk_list_multi_host(self):
        hostnames = ['host1', 'host2', 'host3']
        args = self.parser.parse_args('disk list'.split() + hostnames)
        assert args.host == hostnames

    def test_disk_zap_help(self, capsys):
        with pytest.raises(SystemExit):
            self.parser.parse_args('disk zap --help'.split())
        out, err = capsys.readouterr()
        assert 'usage: ceph-deploy disk zap' in out

    def test_disk_zap_host_required(self, capsys):
        with pytest.raises(SystemExit):
            self.parser.parse_args('disk zap'.split())
        out, err = capsys.readouterr()

# Path: ceph_deploy/cli.py
# def get_parser():
#     epilog_text = "See 'ceph-deploy <command> --help' for help on a specific command"
#     parser = argparse.ArgumentParser(
#         prog='ceph-deploy',
#         formatter_class=argparse.RawDescriptionHelpFormatter,
#         description='Easy Ceph deployment\n\n%s' % __header__,
#         epilog=epilog_text
#         )
#     verbosity = parser.add_mutually_exclusive_group(required=False)
#     verbosity.add_argument(
#         '-v', '--verbose',
#         action='store_true', dest='verbose', default=False,
#         help='be more verbose',
#         )
#     verbosity.add_argument(
#         '-q', '--quiet',
#         action='store_true', dest='quiet',
#         help='be less verbose',
#         )
#     parser.add_argument(
#         '--version',
#         action='version',
#         version='%s' % ceph_deploy.__version__,
#         help='the current installed version of ceph-deploy',
#         )
#     parser.add_argument(
#         '--username',
#         help='the username to connect to the remote host',
#         )
#     parser.add_argument(
#         '--overwrite-conf',
#         action='store_true',
#         help='overwrite an existing conf file on remote host (if present)',
#         )
#     parser.add_argument(
#         '--ceph-conf',
#         dest='ceph_conf',
#         help='use (or reuse) a given ceph.conf file',
#     )
#     sub = parser.add_subparsers(
#         title='commands',
#         metavar='COMMAND',
#         help='description',
#         )
#     sub.required = True
#     entry_points = [
#         (ep.name, ep.load())
#         for ep in pkg_resources.iter_entry_points('ceph_deploy.cli')
#         ]
#     entry_points.sort(
#         key=lambda name_fn: getattr(name_fn[1], 'priority', 100),
#         )
#     for (name, fn) in entry_points:
#         p = sub.add_parser(
#             name,
#             description=fn.__doc__,
#             help=fn.__doc__,
#             )
#         if not os.environ.get('CEPH_DEPLOY_TEST'):
#             p.set_defaults(cd_conf=ceph_deploy.conf.cephdeploy.load())
# 
#         # flag if the default release is being used
#         p.set_defaults(default_release=False)
#         fn(p)
#         p.required = True
#     parser.set_defaults(
#         cluster='ceph',
#         )
# 
#     return parser
# 
# Path: ceph_deploy/tests/util.py
# def assert_too_few_arguments(err):
#     assert ("error: too few arguments" in err or
#             "error: the following argument" in err)


# Path: ceph_deploy/tests/parser/test_disk.py
import pytest
from ceph_deploy.cli import get_parser
from ceph_deploy.tests.util import assert_too_few_arguments

        with pytest.raises(SystemExit):
            self.parser.parse_args('disk list'.split())
        out, err = capsys.readouterr()
        assert_too_few_arguments(err)

    def test_disk_list_single_host(self):
        args = self.parser.parse_args('disk list host1'.split())
        assert args.host[0] == 'host1'
        assert args.debug is False

    def test_disk_list_single_host_debug(self):
        args = self.parser.parse_args('disk list --debug host1'.split())
        assert args.host[0] == 'host1'
        assert args.debug is True

    def test_disk_list_multi_host(self):
        hostnames = ['host1', 'host2', 'host3']
        args = self.parser.parse_args('disk list'.split() + hostnames)
        assert args.host == hostnames

    def test_disk_zap_help(self, capsys):
        with pytest.raises(SystemExit):
            self.parser.parse_args('disk zap --help'.split())
        out, err = capsys.readouterr()
        assert 'usage: ceph-deploy disk zap' in out

    def test_disk_zap_host_required(self, capsys):
        with pytest.raises(SystemExit):
            self.parser.parse_args('disk zap'.split())
        out, err = capsys.readouterr()

        assert_too_few_arguments(err)