예제 #1
0
    def test_basic_generation_works(self):
        # when running pelican without settings, it should pick up the default
        # ones and generate the output without raising any exception / issuing
        # any warning.
        with temporary_folder() as temp_path:
            pelican = Pelican(path=INPUT_PATH, output_path=temp_path)
            pelican.run()

        # the same thing with a specified set of settins should work
        with temporary_folder() as temp_path:
            pelican = Pelican(path=INPUT_PATH, output_path=temp_path,
                              settings=read_settings(SAMPLE_CONFIG))
예제 #2
0
 def test_creates_gzip_file(self):
     '''Test that a file matching the input filename with a .gz extension is
     created.'''
     # The plugin walks over the output content after the finalized signal
     # so it is safe to assume that the file exists (otherwise walk would
     # not report it). Therefore, create a dummy file to use.
     with temporary_folder() as tempdir:
         (_, a_html_filename) = tempfile.mkstemp(suffix='.html', dir=tempdir)
         gzip_cache.create_gzip_file(a_html_filename)
         self.assertTrue(os.path.exists(a_html_filename + '.gz'))
예제 #3
0
 def test_creates_gzip_file(self):
     '''Test that a file matching the input filename with a .gz extension is
     created.'''
     # The plugin walks over the output content after the finalized signal
     # so it is safe to assume that the file exists (otherwise walk would
     # not report it). Therefore, create a dummy file to use.
     with temporary_folder() as tempdir:
         (_, a_html_filename) = tempfile.mkstemp(suffix='.html',
                                                 dir=tempdir)
         gzip_cache.create_gzip_file(a_html_filename)
         self.assertTrue(os.path.exists(a_html_filename + '.gz'))