Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (16 sloc) 0.48 kB
try:
import pyjslib
except:
import __builtin__ as pyjslib
from UnitTest import UnitTest
class Foo:pass
class JSOTest(UnitTest):
"""tests for javascript object conversion"""
def testJSObject(self):
f1 = Foo()
d = {'f1key': f1}
self.assertEqual(pyjslib.toJSObjects(d).f1key, f1)
f2 = Foo()
d = {'x':1, 'y':[1,2,3], 'z':{'a':3}, 'f': f1}
dd = {'d':d}
self.assertEqual(pyjslib.toJSObjects(dd).d.z.a, 3)
Jump to Line
Something went wrong with that request. Please try again.