Beispiel #1
0
 def _runTest_(self, expectedResult, configFile=None):
     if (configFile is None):
         conf = os.path.join(self.site.getSiteDir(), "test.config")
     else:
         conf = configFile
     update = updateSite.UpdateSite(conf, None, ui=SiteUtils.SilentUI())
     update.buildSite()
     comp = SiteUtils.DirCompare()
     res = comp.compare(self.site.getDestDir(), expectedResult)
     self.failUnless(res is None, res)
Beispiel #2
0
	def _runTest_ (self, expectedResult, classes=None):
		if (classes is not None):
			config = {'classes': classes}
		else:
			config = {}
		conf = os.path.join (self.site.getSiteDir(), "test.config")
		update = updateSite.UpdateSite (conf, None, options=config, ui=SiteUtils.SilentUI())
		update.buildSite()
		comp = SiteUtils.DirCompare()
		res = comp.compare (self.site.getDestDir(), expectedResult)
		self.failUnless (res is None, res)
Beispiel #3
0
 def _runErrorTest_(self, expectedResult, configFile=None):
     if (configFile is None):
         conf = os.path.join(self.site.getSiteDir(), "test.config")
     else:
         conf = configFile
     ui = ErrorUI()
     root = logging.getLogger()
     root.setLevel(logging.CRITICAL)
     update = updateSite.UpdateSite(conf, None, ui=ui)
     update.buildSite()
     self.failUnless(
         ui.errorMessage == expectedResult,
         "Received error: \n[%s] expected error \n[%s]" %
         (ui.errorMessage, expectedResult))