Skip to content

Commit

Permalink
added test for redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jun 1, 2015
1 parent 19a9085 commit 9e8ed2d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_integration.py
Expand Up @@ -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."""

Expand Down

0 comments on commit 9e8ed2d

Please sign in to comment.