Author: collin.winter Date: Tue Jul 10 17:34:18 2007 New Revision: 56242 Modified: sandbox/trunk/2to3/pytree.py sandbox/trunk/2to3/tests/test_pytree.py Log: Fix a bug where set_prefix() didn't register that the node had changed. Modified: sandbox/trunk/2to3/pytree.py ============================================================================== --- sandbox/trunk/2to3/pytree.py (original) +++ sandbox/trunk/2to3/pytree.py Tue Jul 10 17:34:18 2007 @@ -304,6 +304,7 @@ def set_prefix(self, prefix): """Sets the prefix for the node.""" + self.changed() self.prefix = prefix def get_prefix(self): Modified: sandbox/trunk/2to3/tests/test_pytree.py ============================================================================== --- sandbox/trunk/2to3/tests/test_pytree.py (original) +++ sandbox/trunk/2to3/tests/test_pytree.py Tue Jul 10 17:34:18 2007 @@ -67,8 +67,10 @@ def testLeafPrefix(self): l1 = pytree.Leaf(100, "foo") self.assertEqual(l1.get_prefix(), "") + self.failIf(l1.was_changed) l1.set_prefix(" ##\n\n") self.assertEqual(l1.get_prefix(), " ##\n\n") + self.failUnless(l1.was_changed) def testNode(self): l1 = pytree.Leaf(100, "foo")
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4