Commits

megamahi committed e63d020 Merge

Merge branch 'release/2.0.0a'

Comments (0)

Files changed (7)

-recursive-include tw2/util/static *
-recursive-include tw2/util/templates *
+recursive-include tw2/util/html5shim/static *
+recursive-include tw2/util/html5shim/templates *
-[egg_info]
-tag_build = dev
-tag_date = true
-
 [nosetests]
 where = tests
 
 from setup_ext import UpdateHTML5ShivCommand
 
+import multiprocessing
+import logging
+
 setup(
     name='tw2.util.html5shim',
     version='2.0.0a',
             js.write(data)
 
         # Update version.py
-        vs_file = "version_num = '{ver_num}'".format(ver_num=ver_num)
+        vs_file = "_version_num_ = '{ver_num}'".format(ver_num=ver_num)
 
         with open('tw2/util/html5shim/version.py', 'w') as vs_py:
             print "Writing new version.py"

tests/test_resources.py

+import tw2.core as twc
+from nose.tools import eq_
+
+from tw2.util.html5shim import html5shim_js
+try:
+    from tw2.util.html5shim import version
+    _ver_num_ = version._version_num_
+except ImportError:
+    _ver_num_ = 'pre3.5'
+
+def request_local_tst():
+    global _request_local, _request_id
+# if _request_id is None:
+# raise KeyError('must be in a request')
+    if _request_local == None:
+        _request_local = {}
+    try:
+        return _request_local[_request_id]
+    except KeyError:
+        rl_data = {}
+        _request_local[_request_id] = rl_data
+        return rl_data
+
+twc.core.request_local = request_local_tst
+_request_local = {}
+_request_id = 'whatever'
+
+def setup():
+    twc.core.request_local = request_local_tst
+    twc.core.request_local()['middleware'] = twc.make_middleware()
+
+def test_html5shim_js():
+    shim = html5shim_js.req()
+    eq_(shim.link, '/resources/tw2.util.html5shim/static/html5shim/%s/html5shim.min.js'% _ver_num_)

tests/test_widget.py

-from tw2.core.testbase import WidgetTest
-from tw2.util import *
-
-class TestUtil(WidgetTest):
-    # place your widget at the TestWidget attribute
-    widget = Util
-    # Initilization args. go here 
-    attrs = {'id':'util-test'}
-    params = {}
-    expected = """<div id="util-test"></div>"""

tw2/util/html5shim/version.py

-version_num = 'pre3.5'
+_version_num_ = 'pre3.5'