[py-svn] r36435 - py/dist/py/test/rsession/testing

fijal at codespeak.net fijal at codespeak.net
Wed Jan 10 21:50:43 CET 2007


Author: fijal
Date: Wed Jan 10 21:50:41 2007
New Revision: 36435

Modified:
   py/dist/py/test/rsession/testing/test_webjs.py
Log:
Fix the test to work in case of LSession as well


Modified: py/dist/py/test/rsession/testing/test_webjs.py
==============================================================================
--- py/dist/py/test/rsession/testing/test_webjs.py	(original)
+++ py/dist/py/test/rsession/testing/test_webjs.py	Wed Jan 10 21:50:41 2007
@@ -10,6 +10,7 @@
 def setup_module(mod):
     # load HTML into window object
     html = here.join('../webdata/index.html').read()
+    mod.html = html
     from pypy.translator.js.modules import dom
     mod.dom = dom
     dom.window = dom.Window(html)
@@ -23,6 +24,10 @@
     mod.webjs = webjs
     mod.exported_methods = exported_methods
 
+def setup_function(f):
+    dom.window = dom.Window(html)
+    dom.document = dom.window.document
+
 def test_html_loaded():
     body = dom.window.document.getElementsByTagName('body')[0]
     assert len(body.childNodes) > 0
@@ -121,7 +126,7 @@
     webjs.process(msg)
     schedule_callbacks(exported_methods)
     # ouch
-    assert dom.document.getElementById('modules/foo.py').childNodes[1].\
+    assert dom.document.getElementById('modules/foo.py').childNodes[0].\
         childNodes[0].childNodes[0].childNodes[0].nodeValue == 'F'
 
 # XXX: Write down test for full run



More information about the pytest-commit mailing list