[Checkins] SVN: zc.selenium/trunk/ - pytest's selenium coverts arguments to unicode now. This allows calls like

Christian Zagrodnick cz at gocept.com
Thu Jan 22 07:49:51 EST 2009


Log message for revision 94934:
  - pytest's selenium coverts arguments to unicode now. This allows calls like
    ``self.selenium.pause(500)``.
  
  

Changed:
  U   zc.selenium/trunk/CHANGES.txt
  U   zc.selenium/trunk/src/zc/selenium/pytest.py
  U   zc.selenium/trunk/src/zc/selenium/pytest.txt

-=-
Modified: zc.selenium/trunk/CHANGES.txt
===================================================================
--- zc.selenium/trunk/CHANGES.txt	2009-01-22 12:38:52 UTC (rev 94933)
+++ zc.selenium/trunk/CHANGES.txt	2009-01-22 12:49:51 UTC (rev 94934)
@@ -8,6 +8,8 @@
 
 - Moved self-test from configure.zcml to tests.zcml to not automatically
   include them when zc.selenium is included.
+- pytest's selenium coverts arguments to unicode now. This allows calls like
+  ``self.selenium.pause(500)``.
 
 1.1.0 (2009-01-19)
 ------------------

Modified: zc.selenium/trunk/src/zc/selenium/pytest.py
===================================================================
--- zc.selenium/trunk/src/zc/selenium/pytest.py	2009-01-22 12:38:52 UTC (rev 94933)
+++ zc.selenium/trunk/src/zc/selenium/pytest.py	2009-01-22 12:49:51 UTC (rev 94934)
@@ -104,7 +104,8 @@
             comment_arg1 = ('%s:%s <span class="longpath">%s:%d</span>' %
                 (base, frame.f_lineno, filename, frame.f_lineno))
             self.raw('comment', comment_arg1, '', cssClass='lineinfo')
-        self.raw(self.__name__, escape(arg1), escape(arg2), self.cssClass)
+        self.raw(self.__name__, escape(unicode(arg1)), escape(unicode(arg2)),
+                 self.cssClass)
 
     def raw(self, name, arg1, arg2, cssClass):
         append = self.output.append

Modified: zc.selenium/trunk/src/zc/selenium/pytest.txt
===================================================================
--- zc.selenium/trunk/src/zc/selenium/pytest.txt	2009-01-22 12:38:52 UTC (rev 94933)
+++ zc.selenium/trunk/src/zc/selenium/pytest.txt	2009-01-22 12:49:51 UTC (rev 94934)
@@ -63,6 +63,7 @@
     ...         s.comment("show something")
     ...         s.foo('bar')
     ...         s.splat('eeek', 'oy')
+    ...         s.foo(27)
     ...
     ...     def test2(self):
     ...         """Show something
@@ -133,6 +134,16 @@
     <td>eeek</td>
     <td>oy</td>
     </tr>
+    <tr class="comment lineinfo">
+    <td>comment</td>
+    <td><doctest pytest.txt[1]>:13 ...</td>
+    <td></td>
+    </tr>
+    <tr class="foo">
+    <td>foo</td>
+    <td>27</td>
+    <td></td>
+    </tr>
     <tr class="open">
     <td>open</td>
     <td>http://127.0.0.1/@@/selenium-pop.html</td>
@@ -151,7 +162,7 @@
     </tr>
     <tr class="comment lineinfo">
     <td>comment</td>
-    <td><doctest pytest.txt[1]>:18 ...</td>
+    <td><doctest pytest.txt[1]>:19 ...</td>
     <td></td>
     </tr>
     <tr class="foo">
@@ -182,10 +193,10 @@
 
 - Methods emit Selenium commands by calling methods on self.selenium.
   The method names become Selenium commands.  Methods take one or 2
-  string arguments.  The pytest framework will accept any method name
-  and blindly create a Selenium statement.  In this example, I used
-  invalid Selenium commands, "foo" and "splat" to illustrate
-  this. Ultimately, we're just generating HTML rows. :)
+  arguments which are converted to a string.  The pytest framework will
+  accept any method name and blindly create a Selenium statement.  In
+  this example, I used invalid Selenium commands, "foo" and "splat" to
+  illustrate this. Ultimately, we're just generating HTML rows. :)
 
 - For each non-comment Selenium command, a comment was generated
   giving the file name and line number.  (The details of the generated



More information about the Checkins mailing list