From: Edward Z. Yang Date: Sat, 6 Feb 2010 23:49:46 +0000 (-0500) Subject: Add inclusions and exclusions for web verification. X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/commitdiff_plain/aecc54f5ab2f277c26bc912a63dae90ccb87e96d Add inclusions and exclusions for web verification. Signed-off-by: Edward Z. Yang --- diff --git a/wizard/app/__init__.py b/wizard/app/__init__.py index f1ad52b..ae99e3e 100644 --- a/wizard/app/__init__.py +++ b/wizard/app/__init__.py @@ -373,11 +373,15 @@ class Application(object): not to depend on pages that are not the main page. """ raise NotImplementedError - def checkWebPage(self, deployment, page, *outputs): + def checkWebPage(self, deployment, page, outputs=[], exclude=[]): """ Checks if a given page of an autoinstall contains a particular string. """ page = deployment.fetch(page) + for x in exclude: + if page.find(x) != -1: + logging.info("checkWebPage (failed due to %s):\n\n%s", x, page) + return False votes = 0 for output in outputs: votes += page.find(output) != -1 diff --git a/wizard/app/mediawiki.py b/wizard/app/mediawiki.py index 8c874e0..7b355af 100644 --- a/wizard/app/mediawiki.py +++ b/wizard/app/mediawiki.py @@ -39,7 +39,7 @@ class Application(app.Application): def detectVersion(self, deployment): return self.detectVersionFromFile("includes/DefaultSettings.php", php.re_var("wgVersion")) def checkWeb(self, deployment): - return self.checkWebPage(deployment, "/index.php?title=Main_Page", "