Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_validate_readme_rst():
metadata = {
'description_content_type': 'text/x-rst',
'description': "Invalid ``rst'",
}
problems = fv.validate_readme_rst(metadata)
assert len(problems) == 2 # 1 message that rst is invalid + 1 with details
assert "valid rst" in problems[0]
# Markdown should be ignored
metadata = {
'description_content_type': 'text/markdown',
'description': "Invalid `rst'",
}
problems = fv.validate_readme_rst(metadata)
assert problems == []
def test_validate_readme_rst():
metadata = {
'description_content_type': 'text/x-rst',
'description': "Invalid ``rst'",
}
problems = fv.validate_readme_rst(metadata)
assert len(problems) == 2 # 1 message that rst is invalid + 1 with details
assert "valid rst" in problems[0]
# Markdown should be ignored
metadata = {
'description_content_type': 'text/markdown',
'description': "Invalid `rst'",
}
problems = fv.validate_readme_rst(metadata)
assert problems == []
def test_validate_readme_rst_code():
# Syntax highlighting shouldn't require pygments
metadata = {
'description_content_type': 'text/x-rst',
'description': RST_WITH_CODE,
}
problems = fv.validate_readme_rst(metadata)
for p in problems:
print(p)
assert problems == []