Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

100% test coverage.

  • Loading branch information...
commit 9e88947ba4d5ac9f7ff0ae1dd9aba97217fe615b 1 parent 89333a4
@ralphbean ralphbean authored
Showing with 26 additions and 0 deletions.
  1. +1 −0  setup.py
  2. +25 −0 tests/test_js.py
View
1  setup.py
@@ -17,6 +17,7 @@
zip_safe=False,
include_package_data=True,
test_suite = 'nose.collector',
+ tests_require = ['nose', 'BeautifulSoup', 'genshi'],
entry_points="""
[tw2.widgets]
# Register your widgets so they can be listed in the WidgetBrowser
View
25 tests/test_js.py
@@ -0,0 +1,25 @@
+import tw2.core as twc
+
+def request_local_tst():
+ global _request_local, _request_id
+ 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_excanvas_resource():
+ from tw2.excanvas import excanvas_js
+ target = "tw2.excanvas.base/static/excanvas.min.js"
+ assert(target in excanvas_js.display())
Please sign in to comment.
Something went wrong with that request. Please try again.