

def test_class(self):

    class MyClass():
        ' docstring '
        foo = 7
        foo = (foo + 1)

        def __init__(self):
            self.bar = 7

        def addOne(self):
            self.bar += 1
    code = (py2js(MyClass) + 'var m = new MyClass();')
    assert (self.count('// docstring') == 1)
    assert (evaljs((code + 'm.bar;')) == '7')
    assert (evaljs((code + 'm.addOne();m.bar;')) == '8')
    assert (evaljs((code + 'm.foo;')) == '8')

dataset/ETHPy150Open zoofIO/flexx/flexx/pyscript/tests/test_parser2.py TestClasses.test_class/VarMisuse@78/104 `code`->`self`