Skip to content

Commit

Permalink
Fix tests, hopefully for real this time
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 31, 2016
1 parent 4aa041c commit 0225f88
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 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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0225f88

Please sign in to comment.