Exemplo n.º 1
0
 def compileTemplate(self, templatePath, **kwargs):
     (packageDir, ignored) = os.path.split(__file__)
     templateText = open(
         rdw_helpers.joinPaths(packageDir, "templates", templatePath),
         "r").read()
     return rdw_templating.templateParser().parseTemplate(
         templateText, **kwargs)
Exemplo n.º 2
0
 def testCompileTemplate(self):
    for test in self._getBackupTests():
       parms = self.getParmsForTemplate(rdw_helpers.joinPaths(self.destRoot, test), "repo")
       #print parms
       
       encounteredText = rdw_templating.templateParser().parseTemplate(self._getFileText("", self.getTemplateName()), **parms)
       expectedText = self._getFileText(test, self.getExpectedResultsName())
       
       self.assertEquals(encounteredText, expectedText)
       assert encounteredText == expectedText, "Got:\n" + encounteredText + "\nExpected:\n" + expectedText + "\nEnd"
Exemplo n.º 3
0
    def testCompileTemplate(self):
        for test in self._getBackupTests():
            parms = self.getParmsForTemplate(
                rdw_helpers.joinPaths(self.destRoot, test), "repo")
            #print parms

            encounteredText = rdw_templating.templateParser().parseTemplate(
                self._getFileText("", self.getTemplateName()), **parms)
            expectedText = self._getFileText(test,
                                             self.getExpectedResultsName())

            self.assertEquals(encounteredText, expectedText)
            assert encounteredText == expectedText, "Got:\n" + encounteredText + "\nExpected:\n" + expectedText + "\nEnd"
Exemplo n.º 4
0
 def compileTemplate(self, templatePath, **kwargs):
    (packageDir, ignored) = os.path.split(__file__)
    templateText = open(rdw_helpers.joinPaths(packageDir, "templates", templatePath), "r").read()
    return rdw_templating.templateParser().parseTemplate(templateText, **kwargs)