Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update test_rst_compiler.py
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 31, 2016
1 parent 185182d commit 5f3bd6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_rst_compiler.py
Expand Up @@ -43,6 +43,7 @@
import pytest
import unittest

from nikola.post import Post
import nikola.plugins.compile.rest
from nikola.plugins.compile.rest import vimeo
import nikola.plugins.compile.rest.listing
Expand Down Expand Up @@ -74,14 +75,17 @@ def setHtmlFromRst(self, rst):
depf = os.path.join(tmpdir, 'outf.dep')
with io.open(inf, 'w+', encoding='utf8') as f:
f.write(rst)
self.html = self.compiler.compile_html(inf, outf)
p = Post(inf, self.site.config, outf, False, None, '', self.compiler)
self.site.post_per_input_file[inf] = p
self.html = p.compile_html(inf, outf)
with io.open(outf, 'r', encoding='utf8') as f:
self.html = f.read()
os.unlink(inf)
os.unlink(outf)
p.write_depfile(outf, p._depfile[outf])
if os.path.isfile(depf):
with io.open(depf, 'r', encoding='utf8') as f:
self.assertEqual(self.deps, f.read())
self.assertEqual(self.deps.strip(), f.read().strip())
os.unlink(depf)
else:
self.assertEqual(self.deps, None)
Expand Down

0 comments on commit 5f3bd6d

Please sign in to comment.