def setUp(self): os.chdir(tutils.test_data.path("doctemplate")) self.d = doc.Page("test.html", "Title", pageTitle="PageTitle") self.application = doc.Doc(TRoot([self.d])) self.application.testing = 2 self.pageName = "test.html" testpages.DummyState.setUp(self)
def setUp(self): self.application = doc.Doc( TRoot([ doc.Page(tutils.test_data.path("doctree/test.html"), "Title"), doc.Copy(tutils.test_data.path("doctree/copy")), doc.Copy("copy2", src=tutils.test_data.path("doctree/copy")), sitemap.Sitemap("sitemap.xml") ]))
def test_render(self): app = doc.Doc(tutils.test_data.path("doctree")) with tutils.tmpdir() as t: app.render(t) assert "notcopied" in app.root.namespace["data"] assert not os.path.isfile(os.path.join(t, "_notcopied.html")) assert os.path.isfile(os.path.join(t, "include.css")) assert os.path.isdir(os.path.join(t, "autocopy")) assert os.path.isdir(os.path.join(t, "foo"))
def setUp(self): self.b = blog.Blog( "Blog Title", "blog description", "posts", tutils.test_data.path("testblog"), blog.RecentPosts(5, 5), ) r = TestRoot([ self.b(), self.b.archive("name.html", "Title"), self.b.rss("rss.xml", "RS"), ]) r.site_url = "foo.com" r.postfix = TestPostfix() self.a = doc.Doc(r)
def test_render_newdir(self): app = doc.Doc(tutils.test_data.path("doctree")) with tutils.tmpdir() as t: app.render(os.path.join(t, "newdir"))
def setUp(self): self.application = doc.Doc(TRoot([DummyPage()]))
def setUp(self): self.application = doc.Doc(TRoot([doc.Copy("bar", "foo")])) self.pageName = "bar" testpages.DummyState.setUp(self)
def test_init(self): a = doc.Doc( TestRoot([ blog.BlogDirectory(tutils.test_data.path("testblog"), None, DummyBlog()) ]))