# Path: pypinyin/runner.py
# def get_parser():
#     parser = ArgumentParser(description='convert chinese to pinyin.')
#     parser.add_argument('-V', '--version', action='version',
#                         version='{0} {1}'.format(
#                             pypinyin.__title__, pypinyin.__version__
#                         ))
#     # 要执行的函数名称
#     parser.add_argument('-f', '--func',
#                         help='function name (default: "pinyin")',
#                         choices=['pinyin', 'slug'],
#                         default='pinyin')
#     # 拼音风格
#     parser.add_argument(
#         '-s', '--style',
#         help='pinyin style (default: "{0}")'.format(default_style),
#         choices=style_map.keys(), default=default_style
#     )
#     parser.add_argument('-p', '--separator',
#                         help='slug separator (default: "-")',
#                         default='-')
#     parser.add_argument('-e', '--errors',
#                         help=('how to handle none-pinyin string'
#                               ' (default: "default")'),
#                         choices=['default', 'ignore', 'replace'],
#                         default='default')
#     # 输出多音字
#     parser.add_argument('-m', '--heteronym', help='enable heteronym',
#                         action='store_true')
#     # 要查询的汉字
#     parser.add_argument('hans', help='chinese string')
#     return parser


from pypinyin.runner import get_parser
    import pytest
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals



def test_default():
    options = get_parser().parse_args(['你好'])
    assert options.func == 'pinyin'
    assert options.style == 'zh4ao'
    assert options.separator == '-'
    assert not options.heteronym
    assert options.hans == '你好'
    assert options.errors == 'default'


def test_custom():

# Path: pypinyin/runner.py
# def get_parser():
#     parser = ArgumentParser(description='convert chinese to pinyin.')
#     parser.add_argument('-V', '--version', action='version',
#                         version='{0} {1}'.format(
#                             pypinyin.__title__, pypinyin.__version__
#                         ))
#     # 要执行的函数名称
#     parser.add_argument('-f', '--func',
#                         help='function name (default: "pinyin")',
#                         choices=['pinyin', 'slug'],
#                         default='pinyin')
#     # 拼音风格
#     parser.add_argument(
#         '-s', '--style',
#         help='pinyin style (default: "{0}")'.format(default_style),
#         choices=style_map.keys(), default=default_style
#     )
#     parser.add_argument('-p', '--separator',
#                         help='slug separator (default: "-")',
#                         default='-')
#     parser.add_argument('-e', '--errors',
#                         help=('how to handle none-pinyin string'
#                               ' (default: "default")'),
#                         choices=['default', 'ignore', 'replace'],
#                         default='default')
#     # 输出多音字
#     parser.add_argument('-m', '--heteronym', help='enable heteronym',
#                         action='store_true')
#     # 要查询的汉字
#     parser.add_argument('hans', help='chinese string')
#     return parser


# Path: tests/test_cmd.py
from pypinyin.runner import get_parser
    import pytest

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals



def test_default():
    options = get_parser().parse_args(['你好'])
    assert options.func == 'pinyin'
    assert options.style == 'zh4ao'
    assert options.separator == '-'
    assert not options.heteronym
    assert options.hans == '你好'
    assert options.errors == 'default'


def test_custom():

    options = get_parser().parse_args(['--func', 'slug',