def testExport(self):
        # Delete the output dir
        outdir = TempDirPath()
        # Load a package
        package = Package.load('testPackage.elp')
        # Do the export
        exporter = WebsiteExport('../exe/webui/style/default', 
                                 outdir,
                                 '../exe/webui/images', 
                                 '../exe/webui/scripts',
                                 '../exe/webui/templates')
        exporter.export(package)
        # Check that it all exists now
        assert outdir.isdir()
        assert (outdir / 'index.html').isfile()
        # Check that the style sheets have been copied
        for filename in Path('../exe/webui/style/default').files():
            assert ((outdir / filename.basename()).exists(),
                    'Style file "%s" not copied' % (outdir / filename.basename()))

        # Check that each node in the package has had a page made
        pagenodes  = Set([p.node for p in exporter.pages])
        othernodes = Set(self._getNodes([], package.root))
        assert pagenodes == othernodes

        for page in exporter.pages:
            self._testPage(page, outdir)
Exemple #2
0
    def testExport(self):
        # Delete the output dir
        outdir = TempDirPath()

        G.application = Application()

        G.application.loadConfiguration()
        G.application.preLaunch()

        # Load a package
        package = Package.load('testing/testPackage2.elp')
        # Do the export
        style_dir = G.application.config.stylesDir / package.style

        exporter = WebsiteExport(G.application.config, style_dir, outdir)

        exporter.export(package)
        # Check that it all exists now
        assert outdir.isdir()
        assert (outdir / 'index.html').isfile()
        # Check that the style sheets have been copied
        for filename in style_dir.files():
            assert ((outdir / filename.basename()).exists(),
                    'Style file "%s" not copied' %
                    (outdir / filename.basename()))

        # Check that each node in the package has had a page made
        pagenodes = Set([p.node for p in exporter.pages])
        othernodes = Set(self._getNodes([], package.root))
        assert pagenodes == othernodes

        for page in exporter.pages:
            self._testPage(page, outdir)
Exemple #3
0
    def testExport(self):
        # Delete the output dir
        outdir = TempDirPath()
        
        G.application = Application()
        
        G.application.loadConfiguration()
        G.application.preLaunch()
        
        # Load a package
        package = Package.load('testing/testPackage2.elp')
        # Do the export
        style_dir = G.application.config.stylesDir / package.style
        
        exporter = WebsiteExport(G.application.config,
                                 style_dir, 
                                 outdir)
        
        exporter.export(package)
        # Check that it all exists now
        assert outdir.isdir()
        assert (outdir / 'index.html').isfile()
        # Check that the style sheets have been copied
        for filename in style_dir.files():
            assert ((outdir / filename.basename()).exists(),
                    'Style file "%s" not copied' % (outdir / filename.basename()))

        # Check that each node in the package has had a page made
        pagenodes  = Set([p.node for p in exporter.pages])
        othernodes = Set(self._getNodes([], package.root))
        assert pagenodes == othernodes

        for page in exporter.pages:
            self._testPage(page, outdir)
Exemple #4
0
 def testExport(self):
     outdir = TempDirPath()
     package = Package.load('testPackage.elp')
     exporter = WebsiteExport('../exe/webui/style/default', 
                              outdir,
                              '../exe/webui/images', 
                              '../exe/webui/scripts',
                              '../exe/webui/templates')
     exporter.export(package)
     assert outdir.isdir()
     assert (outdir / 'index.html').isfile()
     for filename in Path('../exe/webui/style/default').files():
         assert ((outdir / filename.basename()).exists(),
                 'Style file "%s" not copied' % (outdir / filename.basename()))
     pagenodes  = Set([p.node for p in exporter.pages])
     othernodes = Set(self._getNodes([], package.root))
     assert pagenodes == othernodes
     for page in exporter.pages:
         self._testPage(page, outdir)
    def testExport(self):
        # Delete the output dir
        outdir = TempDirPath()
        
        G.application = Application()
        
        G.application.loadConfiguration()
        G.application.preLaunch()
        
        # Load a package
        package = Package.load('testing/testPackage2.elp')
        # Do the export
        style_dir = G.application.config.stylesDir / package.style
        
        exporter = WebsiteExport(G.application.config,
                                 style_dir, 
                                 outdir)
        
        exporter.export(package)
        # Check that it all exists now
        assert outdir.isdir()
        assert (outdir / 'index.html').isfile()
        # Check that the style sheets have been copied
        for filename in style_dir.files():
            
            #Skip the styles config.xml - that should not be included
            if filename.basename() == "config.xml":
                continue
            
            assert ((outdir / filename.basename()).exists(),
                    'Style file "%s" not copied' % (outdir / filename.basename()))
            #check the modification time is correct
            f_dst = Path(outdir/filename.basename())
            f_src = Path(filename)
            
            self.assertTrue(
                TestUtils.mod_time_diff(f_dst, f_src) < 0.1,
                "Modification time in style dir preserved")

        for res_file in package.resourceDir.files():
            dst_file = Path(outdir/ res_file.basename())
            self.assertTrue(dst_file.isfile())
            
            self.assertTrue(
                TestUtils.mod_time_diff(res_file, dst_file) < 0.1,
                "Resource file %s has same mod time as origin" \
                % res_file.basename())

        #test that everything that was copied hahs the right mod time
        copy_list = package.make_system_copy_list(style_dir, 
                                  G.application.config.webDir/"scripts" , 
                                  G.application.config.webDir/"templates", 
                                  G.application.config.webDir/"images", 
                                  G.application.config.webDir/"css", 
                                  outdir)
        TestUtils.check_copy_list_mod_time(copy_list, self)

        # Check that each node in the package has had a page made
        pagenodes  = Set([p.node for p in exporter.pages])
        othernodes = Set(self._getNodes([], package.root))
        assert pagenodes == othernodes

        for page in exporter.pages:
            self._testPage(page, outdir)