Skip to content
Permalink
Browse files

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 5f3bd6d6305015817fbb9a7563cf32f54f7a8c0f
Showing with 6 additions and 2 deletions.
  1. +6 −2 tests/test_rst_compiler.py
@@ -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
@@ -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)

0 comments on commit 5f3bd6d

Please sign in to comment.
You can’t perform that action at this time.