def test_js_string(self): import js # Basic ASCII strings work as expected. s = js.String("hello world") assert str(s) == "hello world" assert len(s) == 11 # Unicode in, unicode out. s = js.String(u"hello \u2603") assert unicode(s) == u"hello \u2603"
def test_js_truthiness(self): import js assert not js.null assert not js.undefined assert not js.false assert not js.Number(0) assert not js.String("") assert js.true assert js.Number(12) assert js.String("xyz")