From: <fwi...@us...> - 2008-11-24 00:00:44
|
Revision: 5624 http://jython.svn.sourceforge.net/jython/?rev=5624&view=rev Author: fwierzbicki Date: 2008-11-24 00:00:42 +0000 (Mon, 24 Nov 2008) Log Message: ----------- Test for basic eval from a bare PythonInterpreter (was throwing an NPE) see http://bugs.jython.org/issue1174. Added Paths: ----------- trunk/jython/tests/java/org/python/util/ trunk/jython/tests/java/org/python/util/InterpreterTest.java Added: trunk/jython/tests/java/org/python/util/InterpreterTest.java =================================================================== --- trunk/jython/tests/java/org/python/util/InterpreterTest.java (rev 0) +++ trunk/jython/tests/java/org/python/util/InterpreterTest.java 2008-11-24 00:00:42 UTC (rev 5624) @@ -0,0 +1,22 @@ +package org.python.util; + +import junit.framework.TestCase; + +import org.python.core.*; +import org.python.util.*; + +public class InterpreterTest extends TestCase { + + /** + * Motivated by a NPE reported on http://bugs.jython.org/issue1174. + */ + public void testBasicEval() throws Exception { + PyDictionary test = new PyDictionary(); + test.__setitem__(new PyUnicode("one"), new PyUnicode("two")); + PythonInterpreter.initialize(System.getProperties(), null, new +String[] {}); + PythonInterpreter interp = new PythonInterpreter(); + PyObject pyo = interp.eval("{u'one': u'two'}"); + assertEquals(test, pyo); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |