From: <cg...@us...> - 2008-12-22 03:30:01
|
Revision: 5787 http://jython.svn.sourceforge.net/jython/?rev=5787&view=rev Author: cgroves Date: 2008-12-22 03:29:57 +0000 (Mon, 22 Dec 2008) Log Message: ----------- Move the test for assigning on top of a Java method to a class that doesn't cause a headless exception; don't worry about the message, just check that the TypeError is raised Modified Paths: -------------- trunk/jython/Lib/test/test_java_integration.py Modified: trunk/jython/Lib/test/test_java_integration.py =================================================================== --- trunk/jython/Lib/test/test_java_integration.py 2008-12-22 03:21:46 UTC (rev 5786) +++ trunk/jython/Lib/test/test_java_integration.py 2008-12-22 03:29:57 UTC (rev 5787) @@ -331,20 +331,11 @@ def test_bad_input_exception(self): self.assertRaises(ValueError, __import__, '') -class ButtonTest(unittest.TestCase): - - def test_setLabel(self): - try: - b = Button() - except HeadlessException: - return # can't raise TestSkipped - try: - b.setLabel = 4 - except TypeError, e: - self.failUnless("can't assign to this attribute in java instance: setLabel" in str(e)) - class ColorTest(unittest.TestCase): + def test_assigning_over_method(self): + self.assertRaises(TypeError, setattr, Color.RED, "getRGB", 4) + def test_static_fields(self): self.assertEquals(Color(255, 0, 0), Color.RED) # The bean accessor for getRed should be active on instances, but the static field red @@ -468,7 +459,6 @@ JavaReservedNamesTest, PyReservedNamesTest, ImportTest, - ButtonTest, ColorTest, TreePathTest, BigDecimalTest, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |