[devtools/qunit] Locate jquery through cubicwew config to handle installed setup
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 18 Jun 2010 18:16:36 +0200
changeset 5794 a6b81d106775
parent 5790 26680cbc507b
child 5795 7947b1af2e82
[devtools/qunit] Locate jquery through cubicwew config to handle installed setup
devtools/qunit.py
--- a/devtools/qunit.py	Fri Jun 18 14:44:22 2010 +0200
+++ b/devtools/qunit.py	Fri Jun 18 18:16:36 2010 +0200
@@ -132,9 +132,11 @@
 
 
         # generate html test file
+        jquery_dir = self.config.locate_resource('jquery.js')
         html_test_file = NamedTemporaryFile(suffix='.html')
         html_test_file.write(make_qunit_html(test_file, depends,
-                             server_data=(self.test_host, self.test_port)))
+                             server_data=(self.test_host, self.test_port),
+                             web_data_path=jquery_dir))
         html_test_file.flush()
         # copying data file
         for data in data_files:
@@ -258,10 +260,11 @@
     }
     """ % (host, port)
 
-def make_qunit_html(test_file, depends=(), server_data=None):
+def make_qunit_html(test_file, depends=(), server_data=None,
+                    web_data_path=cw_path('web', 'data')):
     """"""
     data = {
-            'web_data': cw_path('web', 'data'),
+            'web_data': web_data_path,
             'web_test': cw_path('devtools', 'data'),
         }