def tearDown(self): if self.obj != self.objPython: self.fail("Python object %s differs from JavaScript object %s" % \ (repr(self.objPython), repr(dict(self.obj)))) TestCaseWithContext.tearDown(self)
def tearDown(self): if self.objPython != list(asSeq(self.ctx.globalObject.objJS)): self.fail("Python object %s differs from JavaScript object %s" % \ (repr(self.objPython), repr(list(self.ctx.globalObject.objJS)))) TestCaseWithContext.tearDown(self)
def setUp(self): TestCaseWithContext.setUp(self) class A: pass obj = A() obj.a, obj.b, obj.c, obj.d = 1, 'x', A(), None obj.c.d, obj.c.e = 2, 'yy' self.obj = obj self.ctx.globalObject.obj = obj
def setUp(self): TestCaseWithContext.setUp(self) self.objPython = [11, 22, 33, 44, 55] self.ctx.globalObject.objPython = self.objPython self.ctx.evaluateScript('objJS = [11, 22, 33, 44, 55]') # For the benefit of read-only test cases, the initial value # of obj is the Python object. self.ctx.globalObject.obj = self.objPython
def setUp(self): TestCaseWithContext.setUp(self) self.obj = self.ctx.evaluateScript(""" obj = {a: 1, b: 'x', c: {d: 2, e: 'yy'}, d: undefined}; obj; """)
def setUp(self): TestCaseWithContext.setUp(self) self.objPython = {'a': 11, 'b': 22, 'c': None, '1': 44, '2': 55} self.ctx.globalObject.objPython = self.objPython self.ctx.evaluateScript(""" objJS = function () {}; objJS['a'] = 11; objJS['b'] = 22; objJS['c'] = undefined; objJS['1'] = 44; objJS['2'] = 55;""")
def setUp(self): TestCaseWithContext.setUp(self) self.obj = self.ctx.evaluateScript(""" obj = {a: 1, b: 'x', f: function(x, y) {return x + y}, g: function(x) {return x}, h: function() {return arguments.length}, i: function() {return this.a}, j: function() {return this.b}, k: function() {throw Error('Message')}, }; obj; """)
def setUp(self): TestCaseWithContext.setUp(self) self.obj = (1, 2, 3)
def setUp(self): TestCaseWithContext.setUp(self) self.obj = self.ctx.evaluateScript(""" obj = {a: 1, b: 'x'}; obj; """)
def setUp(self): TestCaseWithContext.setUp(self) self.obj = \ self.ctx.evaluateScript("""({a: 11, b: 22, c: undefined, 1: 44, 2: 55})""") self.objPython = {'a': 11, 'b': 22, 'c': None, '1': 44, '2': 55}
def setUp(self): TestCaseWithContext.setUp(self) self.obj = asSeq(self.ctx.evaluateScript(""" ([1, 2, 3, 4, 5]) """))
def setUp(self): TestCaseWithContext.setUp(self) self.objPython = {'a': 11, 'b': 22, 'c': None, '1': 44, '2': 55} self.ctx.globalObject.objPython = self.objPython self.ctx.evaluateScript("""objJS = {a: 11, b: 22, c: undefined, 1: 44, 2: 55}""")
def setUp(self): TestCaseWithContext.setUp(self) self.obj = asSeq( self.ctx.evaluateScript(""" ([1, 2, 3, 4, 5]) """))