Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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
Esempio 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
Esempio 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
Esempio 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;
       """)
Esempio 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;
       """)
Esempio 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
Esempio 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;""")
Esempio 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;""")
Esempio 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;
       """)
Esempio 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;
       """)
Esempio n. 15
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = (1, 2, 3)
Esempio n. 16
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = self.ctx.evaluateScript("""
       obj = {a: 1, b: 'x'};
       obj;
       """)
Esempio n. 17
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = (1, 2, 3)
Esempio 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}
Esempio n. 19
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = asSeq(self.ctx.evaluateScript("""
       ([1, 2, 3, 4, 5])
       """))
Esempio 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}""")
Esempio 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}
Esempio 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}""")
Esempio n. 23
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = asSeq(
         self.ctx.evaluateScript("""
       ([1, 2, 3, 4, 5])
       """))
Esempio n. 24
0
 def setUp(self):
     TestCaseWithContext.setUp(self)
     self.obj = self.ctx.evaluateScript("""
       obj = {a: 1, b: 'x'};
       obj;
       """)