test_one_default_page_with_path_prefix.py


make_index function

None

make_index source
def make_index(tmp_path: Any) -> Any:
    pages = tmp_path / "pages"
    pages.mkdir()
    fn = pages / "index.md"
    fn.write_text(
        textwrap.dedent(
            """
            ---
            templateKey: blog-post
            tags: ['python',]
            title:  My Awesome Post
            date: 2022-01-21T16:40:34
            published: False

            ---

            This is my awesome post.
            """
        )
    )
    return tmp_path

test_loaded function

None

test_loaded source
def test_loaded(make_index: Any) -> None:
    os.chdir(make_index)
    m = Markata()
    assert len(m.articles) == 1

test_run function

None

test_run source
def test_run(make_index: Any) -> Any:
    os.chdir(make_index)
    m = Markata()
    m.config["output_dir"] = "markout/sub-route/"
    m.config["path_prefix"] = "sub-route/"
    m.run()
    return make_index

test_markout_exists function

None

test_markout_exists source
def test_markout_exists(test_run: Any) -> Any:
    markout = test_run / "markout"
    assert markout.exists()
    sub = test_run / "markout/sub-route"
    assert sub.exists()

test_index_exists function

None

test_index_exists source
def test_index_exists(test_run: Any) -> Any:
    markout = test_run / "markout"
    sub = test_run / "markout/sub-route"
    markout_index = markout / "index.html"
    assert not markout_index.exists()
    sub_index = sub / "index.html"
    assert sub_index.exists()

test_rss_exists function

None

test_rss_exists source
def test_rss_exists(test_run: Any) -> Any:
    markout = test_run / "markout"
    sub = test_run / "markout/sub-route"
    rss = markout / "rss.xml"
    assert not rss.exists()
    sub_rss = sub / "rss.xml"
    assert sub_rss.exists()