How to use the flit.validate.validate_readme_rst function in flit

To help you get started, we’ve selected a few flit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github takluyver / flit / tests / test_validate.py View on Github external
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 == []
github takluyver / flit / tests / test_validate.py View on Github external
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 == []
github takluyver / flit / tests / test_validate.py View on Github external
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 == []