Skip to content
Permalink
Browse files

Fix tests, hopefully for real this time

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 31, 2016
1 parent 4aa041c commit 0225f88cfa0f7a6374f79bb45c2d4a4aa2e4950d
Showing with 6 additions and 2 deletions.
  1. +6 −2 tests/test_rst_compiler.py
@@ -43,6 +43,7 @@
import unittest

from nikola.nikola import Nikola
from nikola.post import Post
import nikola.plugins.compile.rest
from nikola.plugins.compile.rest import gist
from nikola.plugins.compile.rest import vimeo
@@ -84,14 +85,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 0225f88

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