예제 #1
0
 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)
예제 #2
0
 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")
         ]))
예제 #3
0
 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"))
예제 #4
0
 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)
예제 #5
0
 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"))
예제 #6
0
 def setUp(self):
     self.application = doc.Doc(TRoot([DummyPage()]))
예제 #7
0
 def setUp(self):
     self.application = doc.Doc(TRoot([doc.Copy("bar", "foo")]))
     self.pageName = "bar"
     testpages.DummyState.setUp(self)
예제 #8
0
 def test_init(self):
     a = doc.Doc(
         TestRoot([
             blog.BlogDirectory(tutils.test_data.path("testblog"), None,
                                DummyBlog())
         ]))