instance.__set__(se, Py.newInteger(12));
assertEquals(12.0, Py.py2double(instance.__get__(se, PY_TYPE)));
}
public void testBool() throws Exception {
PyDataDescr instance = makeDescriptor(new DescSetup() {
public void setup(DescriptorExposer de) {
de.addFieldGetter("bool", BOOLEAN);
de.addFieldSetter("bool", BOOLEAN);
}
}, "bool");
assertEquals(false, Py.py2boolean(instance.__get__(se, PY_TYPE)));
instance.__set__(se, Py.True);
assertEquals(true, Py.py2boolean(instance.__get__(se, PY_TYPE)));
}