test_markdown.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:hatch 作者: ofek 项目源码 文件源码
def test_badges_multiple():
    with temp_chdir() as d:
        settings = copy_default_settings()
        settings['basic'] = False
        settings['readme']['format'] = 'md'
        settings['readme']['badges'] = [
            {
                'image': 'https://img.shields.io/pypi/v/ok.svg',
                'target': 'https://pypi.org/project/ok',
                'alt': 'Latest PyPI version'
            },
            {
                'image': 'https://img.shields.io/pypi/l/ok.svg',
                'target': 'https://choosealicense.com/licenses',
                'alt': 'License'
            }
        ]
        create_package(d, 'ok', settings)

        contents = read_file(os.path.join(d, 'README.md'))
        parsed = parse(TEMPLATE, contents)

        assert parsed['badges'] == (
            '\n'
            '[![Latest PyPI version](https://img.shields.io/pypi/v/ok.svg)](https://pypi.org/project/ok)\n'
            '[![License](https://img.shields.io/pypi/l/ok.svg)](https://choosealicense.com/licenses)\n'
            '\n'
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号