示例#1
0
文件: query.py 项目: anler/mdblog
def entry_string_to_dict(entry_string):
    "Returns a dictionary with the attributes of an entry parsed from a string"
    headers, body = parse_entry(entry_string)
    entry_dict = {
        "body": render_entry(body)
    }
    entry_dict.update(headers)

    return entry_dict
示例#2
0
    def test_render(self):
        "Test that a text entry is rendered and compiled into an Entry object"
        body = render_entry("# This is the entry")

        self.assertEqual("<h1>This is the entry</h1>", body)