Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
    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
Exemplo n.º 7
0
    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
Exemplo n.º 8
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = self.ctx.evaluateScript("""
       obj = {a: 1,
              b: 'x',
              c: {d: 2,
                  e: 'yy'},
              d: undefined};
       obj;
       """)
Exemplo n.º 9
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = self.ctx.evaluateScript("""
       obj = {a: 1,
              b: 'x',
              c: {d: 2,
                  e: 'yy'},
              d: undefined};
       obj;
       """)
Exemplo n.º 10
0
    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
Exemplo n.º 11
0
 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;""")
Exemplo n.º 12
0
 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;""")
Exemplo n.º 13
0
 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;
       """)
Exemplo n.º 14
0
 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;
       """)
Exemplo n.º 15
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = (1, 2, 3)
Exemplo n.º 16
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = self.ctx.evaluateScript("""
       obj = {a: 1, b: 'x'};
       obj;
       """)
Exemplo n.º 17
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = (1, 2, 3)
Exemplo n.º 18
0
 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}
Exemplo n.º 19
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = asSeq(self.ctx.evaluateScript("""
       ([1, 2, 3, 4, 5])
       """))
Exemplo n.º 20
0
 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}""")
Exemplo n.º 21
0
 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}
Exemplo n.º 22
0
 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}""")
Exemplo n.º 23
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = asSeq(
         self.ctx.evaluateScript("""
       ([1, 2, 3, 4, 5])
       """))
Exemplo n.º 24
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = self.ctx.evaluateScript("""
       obj = {a: 1, b: 'x'};
       obj;
       """)