Skip to content

Commit 5f3bd6d

Browse files
committedJul 31, 2016
Update test_rst_compiler.py
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 185182d commit 5f3bd6d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎tests/test_rst_compiler.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import pytest
4444
import unittest
4545

46+
from nikola.post import Post
4647
import nikola.plugins.compile.rest
4748
from nikola.plugins.compile.rest import vimeo
4849
import nikola.plugins.compile.rest.listing
@@ -74,14 +75,17 @@ def setHtmlFromRst(self, rst):
7475
depf = os.path.join(tmpdir, 'outf.dep')
7576
with io.open(inf, 'w+', encoding='utf8') as f:
7677
f.write(rst)
77-
self.html = self.compiler.compile_html(inf, outf)
78+
p = Post(inf, self.site.config, outf, False, None, '', self.compiler)
79+
self.site.post_per_input_file[inf] = p
80+
self.html = p.compile_html(inf, outf)
7881
with io.open(outf, 'r', encoding='utf8') as f:
7982
self.html = f.read()
8083
os.unlink(inf)
8184
os.unlink(outf)
85+
p.write_depfile(outf, p._depfile[outf])
8286
if os.path.isfile(depf):
8387
with io.open(depf, 'r', encoding='utf8') as f:
84-
self.assertEqual(self.deps, f.read())
88+
self.assertEqual(self.deps.strip(), f.read().strip())
8589
os.unlink(depf)
8690
else:
8791
self.assertEqual(self.deps, None)

0 commit comments

Comments
 (0)
Please sign in to comment.