Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: tests/test_parse_page_content.py

Issue 29516687: Issue 4488 - Add support for JSON page front matter (Closed) Base URL: https://hg.adblockplus.org/cms
Patch Set: Created Aug. 16, 2017, 12:43 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python2
Vasily Kuznetsov 2017/08/16 18:34:56 I think we've discussed this and I have suggested
rosie 2017/08/19 01:56:34 Done.
2
3 import os
4
5 from cms.converters import parse_page_content
6
7 test_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
8 'frontmatter_samples')
9
10
11 def test_parse_page_content():
12 page = 'test_page_name'
13 with open(os.path.join(test_path, 'front_matter_orig.html')) as orig_data:
14 orig_content = orig_data.read()
15 orig = parse_page_content(page, orig_content)
16 with open(os.path.join(test_path, 'front_matter_json.html')) as json_data:
17 json_content = json_data.read()
18 json = parse_page_content(page, json_content)
19 assert orig[0] == json[0]
OLDNEW

Powered by Google App Engine
This is Rietveld