Skip to content

Commit

Permalink
100% test coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Jun 29, 2011
1 parent 89333a4 commit 9e88947
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
zip_safe=False, zip_safe=False,
include_package_data=True, include_package_data=True,
test_suite = 'nose.collector', test_suite = 'nose.collector',
tests_require = ['nose', 'BeautifulSoup', 'genshi'],
entry_points=""" entry_points="""
[tw2.widgets] [tw2.widgets]
# Register your widgets so they can be listed in the WidgetBrowser # Register your widgets so they can be listed in the WidgetBrowser
Expand Down
25 changes: 25 additions & 0 deletions tests/test_js.py
Original file line number Original file line Diff line number Diff line change
@@ -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())

0 comments on commit 9e88947

Please sign in to comment.