def test_badges_multiple():
with temp_chdir() as d:
settings = copy_default_settings()
settings['basic'] = False
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.rst'))
parsed = parse(TEMPLATE, contents)
assert parsed['badges'] == (
'\n'
'.. image:: https://img.shields.io/pypi/v/ok.svg\n'
' :target: https://pypi.org/project/ok\n'
' :alt: Latest PyPI version\n'
'\n'
'.. image:: https://img.shields.io/pypi/l/ok.svg\n'
' :target: https://choosealicense.com/licenses\n'
' :alt: License\n'
'\n'
)
评论列表
文章目录