test_default_post_template.py


test_head_config_text_str function

None

test_head_config_text_str source
def test_head_config_text_str(tmp_path):
    with set_directory(tmp_path):
        m = Markata()
        m.config["head"] = {}
        m.config["head"]["text"] = "here"
        post_template.configure(m)
        assert m.config["head"]["text"] == "here"

test_head_config_text_dict function

None

test_head_config_text_dict source
def test_head_config_text_dict(tmp_path):
    with set_directory(tmp_path):
        m = Markata()
        m.config["head"] = {}
        m.config["head"]["text"] = [{"value": "one"}, {"value": "two"}]
        post_template.configure(m)
        assert m.config["head"]["text"] == "one\ntwo"

test_head_config_text_str_toml function

None

test_head_config_text_str_toml source
def test_head_config_text_str_toml(tmp_path):
    with set_directory(tmp_path):
        Path("markata.toml").write_text(
            toml.dumps({"markata": {"head": {"text": "here"}}})
        )
        m = Markata()
        post_template.configure(m)
        assert m.config["head"]["text"] == "here"

test_head_config_text_list_toml function

None

test_head_config_text_list_toml source
def test_head_config_text_list_toml(tmp_path):
    with set_directory(tmp_path):
        Path("markata.toml").write_text(
            toml.dumps(
                {"markata": {"head": {"text": [{"value": "one"}, {"value": "two"}]}}}
            )
        )
        m = Markata()
        post_template.configure(m)
        assert m.config["head"]["text"] == "one\ntwo"