Permalink
Browse files

Found the killer test.

  • Loading branch information...
ralphbean committed Mar 21, 2012
1 parent b387fa4 commit d81926c5a1108079e5a2525e456ad6a077c776d9
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/test_js.py
@@ -15,6 +15,18 @@ def test_js_function(self):
json = self.encode({"onLoad": js_function("do_something")("param")})
eq_(json, '{"onLoad": do_something(\\"param\\")}')
def test_js_function_composition(self):
f = js_function("f")
g = js_function("g")
h = js_function("h")
y = js_symbol("y")
obj = f(g(h("x", y)))
json = self.encode(obj)
eq_(str(f), """f(g(h("x", y)))""")
def test_js_symbol(self):
obj = self.encode({"onLoad": js_symbol("param")})
eq_(obj, '{"onLoad": param}')

0 comments on commit d81926c

Please sign in to comment.