예제 #1
0
def test_saved_html_valid_options_inline(page_layout: es.Page, tmp_path,
                                         monkeypatch):
    monkeypatch.setattr(es.options, "dependency_source", "inline")
    path: Path = tmp_path / "my_page.html"
    page_layout.save_html(str(path))
    html = path.read_text()
    assert html_is_valid(html)
예제 #2
0
def test_rendered_html_valid_toc(page_layout: es.Page, tmp_path):
    path = str(tmp_path / "my_page.html")
    page_layout.table_of_contents = True
    html = pu.publish_html(page_layout,
                           path,
                           return_html=True,
                           dependency_source="cdn")
    assert html_is_valid(html)
예제 #3
0
def test_saved_html_valid_toc(page_layout: es.Page, tmp_path):
    path: Path = tmp_path / "my_page.html"
    page_layout.table_of_contents = True
    page_layout.save_html(str(path), dependency_source="cdn")
    html = path.read_text()
    assert html_is_valid(html)
예제 #4
0
def test_saved_html_valid_bad_source(page_layout: es.Page, tmp_path):
    path: Path = tmp_path / "my_page.html"
    with pytest.raises(ValueError):
        page_layout.save_html(str(path), dependency_source="flapjack")
예제 #5
0
def test_saved_html_valid_inline(page_layout: es.Page, tmp_path):
    path: Path = tmp_path / "my_page.html"
    page_layout.save_html(str(path), dependency_source="inline")
    html = path.read_text()
    assert html_is_valid(html)