[Checkins] SVN: zc.testbrowser/branches/sweh-mozlab0.1.9/src/zc/testbrowser/real.py - added new method 'load_file(file_path)' to load a javascript file to the

Sebastian Wehrmann sw at gocept.com
Mon Jul 7 05:43:27 EDT 2008


Log message for revision 88080:
  - added new method 'load_file(file_path)' to load a javascript file to the
    testbrowser
  - if an error occures in the js file, a more detailed message is now shown
  

Changed:
  U   zc.testbrowser/branches/sweh-mozlab0.1.9/src/zc/testbrowser/real.py

-=-
Modified: zc.testbrowser/branches/sweh-mozlab0.1.9/src/zc/testbrowser/real.py
===================================================================
--- zc.testbrowser/branches/sweh-mozlab0.1.9/src/zc/testbrowser/real.py	2008-07-07 08:36:34 UTC (rev 88079)
+++ zc.testbrowser/branches/sweh-mozlab0.1.9/src/zc/testbrowser/real.py	2008-07-07 09:43:25 UTC (rev 88080)
@@ -120,7 +120,10 @@
             raise RuntimeError('Error connecting to Firefox at %s:%s.'
                 ' Is MozRepl running?' % (host, port))
 
-        for line in open(js_path, 'r'):
+        self.load_file(js_path)
+
+    def load_file(self, file_path):
+        for line in open(file_path, 'r'):
             self.telnet.write(line)
             self.expect([PROMPT, CONTINUATION_PROMPT])
 
@@ -134,8 +137,8 @@
         self.expect()
         self.telnet.write(js)
         i, match, text = self.expect()
-        if '!!!' in text: import pdb;pdb.set_trace() # XXX debug only, remove
-        if '!!!' in text: raise Exception('FAILED: ' + js)
+        #if '!!!' in text: import pdb;pdb.set_trace() # XXX debug only, remove
+        if '!!!' in text: raise Exception('FAILED: ' + text + ' in ' + js)
         result = text.rsplit('\n', 1)
         if len(result) == 1:
             return None



More information about the Checkins mailing list