summaryrefslogtreecommitdiff
path: root/addons/web/static/lib/py.js/test/test.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-04-04 13:46:47 +0200
committerXavier Morel <xmo@openerp.com>2012-04-04 13:46:47 +0200
commit2a8d78c88ccdbdffdad39e41539068bb8fc32fe5 (patch)
treeb23a8f5f26941c7e602d8a5a790317b7c5bfd22b /addons/web/static/lib/py.js/test/test.js
parentd70220631a8053722b46dd6c4ae68ccac5486c00 (diff)
[UP] py.js for Object and Array converters to py types
bzr revid: xmo@openerp.com-20120404114647-t81pw90940canfwg
Diffstat (limited to 'addons/web/static/lib/py.js/test/test.js')
-rw-r--r--addons/web/static/lib/py.js/test/test.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/addons/web/static/lib/py.js/test/test.js b/addons/web/static/lib/py.js/test/test.js
index 31fccc23240..c1f92c44d81 100644
--- a/addons/web/static/lib/py.js/test/test.js
+++ b/addons/web/static/lib/py.js/test/test.js
@@ -376,4 +376,13 @@ describe('numerical protocols', function () {
});
});
});
-}); \ No newline at end of file
+});
+describe('Type converter', function () {
+ it('should convert bare objects to objects', function () {
+ expect(py.eval('foo.bar', {foo: {bar: 3}})).to.be(3);
+ });
+ it('should convert arrays to lists', function () {
+ expect(py.eval('foo[3]', {foo: [9, 8, 7, 6, 5]}))
+ .to.be(6);
+ });
+});