Skip to content
Permalink
Browse files
added test for redirect
  • Loading branch information
ralsina committed Jun 1, 2015
1 parent 19a9085 commit 9e8ed2d8d446dcae0cb9dcde715407be04d4d20d
Showing 1 changed file with 18 additions and 0 deletions.
@@ -232,6 +232,24 @@ def patch_site(self):
outf.write(data)


class RedirectionsTest1(EmptyBuildTest):
"""Check REDIRECTS"""

@classmethod
def patch_site(self):
""""""
conf_path = os.path.join(self.target_dir, "conf.py")
with io.open(conf_path, "a", encoding="utf8") as outf:
outf.write("""\n\nREDIRECTS = [ ("posts/foo.html", "/foo/bar.html"), ]\n\n""")

@classmethod
def fill_site(self):
target_path = os.path.join(self.target_dir, "files", "foo", "bar.html")
nikola.utils.makedirs(os.path.join(self.target_dir, "files", "foo"))
with io.open(target_path, "w+", encoding="utf8") as outf:
outf.write("foo")


class MissingDefaultLanguageTest(TranslatedBuildTest):
"""Make sure posts only in secondary languages work."""

0 comments on commit 9e8ed2d

Please sign in to comment.