]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/app/__init__.py
Refactor more boilerplate out.
[wizard.git] / wizard / app / __init__.py
index ab4d0080423538c7acdb71d932586c87bb97d3ba..483f7ee30c01e8310eded59a8fd9993552747e30 100644 (file)
@@ -246,13 +246,10 @@ class Application(object):
         this application.
         """
         raise NotImplementedError
-    def checkWeb(self, deployment, output=None):
+    def checkWeb(self, deployment):
         """
-        Checks if the autoinstall is viewable from the web.  To get
-        the HTML source that was retrieved, pass a variable containing
-        an empty list to ``output``; it will be mutated to have its
-        first element be the output.  Subclasses should provide an
-        implementation.
+        Checks if the autoinstall is viewable from the web.  Subclasses should
+        provide an implementation.
 
         .. note::
             Finding a reasonable heuristic that works across skinning
@@ -262,6 +259,13 @@ class Application(object):
             not to depend on pages that are not the main page.
         """
         raise NotImplementedError
+    def checkWebPage(self, deployment, page, output):
+        """
+        Checks if a given page of an autoinstall contains a particular string.
+        """
+        page = deployment.fetch(page)
+        logging.info("checkWebPage:\n\n" + page)
+        return page.find(output) != -1
     def checkConfig(self, deployment):
         """
         Checks whether or not an autoinstall has been configured/installed