Skip to content

Commit

Permalink
Fix tests
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 30, 2016
1 parent 51244bd commit b6ce43f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nikola/plugins/compile/rest/__init__.py
Expand Up @@ -89,8 +89,15 @@ def compile_html(self, source, dest, is_two_file=True):
output, error_level, deps = self.compile_html_string(data, source, is_two_file)
output = apply_shortcodes(output, self.site.shortcode_registry, self.site, source)
out_file.write(output)
post = self.site.post_per_input_file[source]
post._depfile[dest] += deps.list
try:
post = self.site.post_per_input_file[source]
except KeyError:
if deps.list:
self.logger.error(
"Cannot save dependencies for post {0} due to unregistered source file name",
source)
else:
post._depfile[dest] += deps.list
if error_level < 3:
return True
else:
Expand Down
2 changes: 2 additions & 0 deletions nikola/plugins/task/galleries.py
Expand Up @@ -416,6 +416,8 @@ def parse_index(self, gallery, input_folder, output_folder):
# may break)
if post.title == 'index':
post.title = os.path.split(gallery)[1]
# Register the post (via #2417)
self.site.post_per_input_file[index_path] = post
else:
post = None
return post
Expand Down
1 change: 1 addition & 0 deletions tests/base.py
Expand Up @@ -197,6 +197,7 @@ def __init__(self):
]
self.debug = True
self.rst_transforms = []
self.post_per_input_file = {}
# This is to make plugin initialization happy
self.template_system = self
self.name = 'mako'
Expand Down

0 comments on commit b6ce43f

Please sign in to comment.