Esempio n. 1
0
 def test_transform_fixes_up_internal_links(self):
   sitegen.transform_soups(self.config, self.soups, self.precomputed)
   html = sitegen.render_html('index',
                              self.config,
                              self.soups,
                              self.precomputed,
                              TEMPLATE_MUSTACHE)
   self.assertTrue('subdir/page1.html' in html,
                   'p1.html link did not get fixed up to page1.html')
Esempio n. 2
0
 def test_transform_fixes_up_internal_links(self):
   sitegen.transform_soups(self.config, self.soups, self.precomputed)
   html = sitegen.render_html('index',
                              self.config,
                              self.soups,
                              self.precomputed,
                              TEMPLATE_MUSTACHE)
   self.assertTrue('subdir/page1.html' in html,
                   'p1.html link did not get fixed up to page1.html')
Esempio n. 3
0
 def test_transforms_not_discard_page_tocs(self):
     # We had a bug where one step of transform lost the info
     # we need to build page-tocs. Make sure that doesn't happen again.
     sitegen.transform_soups(self.config, self.soups, self.precomputed)
     rendered = sitegen.render_html(
         'subdir/page2', self.config, self.soups, self.precomputed, """
                                {{#page_toc}}
                                DEPTH={{depth}} LINK={{link}} TEXT={{text}}
                                {{/page_toc}}
                                """)
     self.assertIn('DEPTH=1 LINK=one TEXT=Section One', rendered)
     self.assertIn('DEPTH=1 LINK=two TEXT=Section Two', rendered)
Esempio n. 4
0
 def test_transforms_not_discard_page_tocs(self):
   # We had a bug where one step of transform lost the info
   # we need to build page-tocs. Make sure that doesn't happen again.
   sitegen.transform_soups(self.config, self.soups, self.precomputed)
   rendered = sitegen.render_html('subdir/page2',
                                  self.config,
                                  self.soups,
                                  self.precomputed,
                                  """
                                  {{#page_toc}}
                                  DEPTH={{depth}} LINK={{link}} TEXT={{text}}
                                  {{/page_toc}}
                                  """)
   self.assertIn('DEPTH=1 LINK=one TEXT=Section One', rendered)
   self.assertIn('DEPTH=1 LINK=two TEXT=Section Two', rendered)