[Zope-dev] code coverage
In test.py there's currently a -T option that enables code coverage using the trace module. Are many people using it ? We'd like to work on including in test.py different coverage methods and outputs in Zope by making it interface with coverage.py from http://www.nedbatchelder.com/code/modules/coverage.html Anyone thinks it could be problematic ? Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: guarded_getattr
Oops, I just noticed there is a CMFCore test failing now, all branches... == ERROR: test_move_cant_create_target_metatype_not_allowed (CMFCore.tests.test_PortalFolder.PortalFolderCopySupportTests) -- Traceback (most recent call last): File /Users/stefan/autotest/temp/python23-zope27-cmf15/Products/CMFCore/ tests/test_PortalFolder.py, line 1021, in test_move_cant_create_target_metatype_not_allowed , ce_regex='Insufficient Privileges' File /Users/stefan/autotest/temp/python23-zope27-cmf15/Products/CMFCore/ tests/test_PortalFolder.py, line 855, in _assertCopyErrorUnauth callable( *args, **kw ) File /Users/stefan/autotest/temp/python23-zope27/lib/python/OFS/ CopySupport.py, line 160, in manage_pasteObjects self._verifyObjectPaste(ob, validate_src=op+1) File /Users/stefan/autotest/temp/python23-zope27-cmf15/Products/CMFCore/ PortalFolder.py, line 533, in _verifyObjectPaste PortalFolder.inheritedAttribute( File /Users/stefan/autotest/temp/python23-zope27/lib/python/OFS/ CopySupport.py, line 358, in _verifyObjectPaste method = self.restrictedTraverse(method_name) File /Users/stefan/autotest/temp/python23-zope27/lib/python/OFS/ Traversable.py, line 204, in restrictedTraverse return self.unrestrictedTraverse(path, default, restricted=1) File /Users/stefan/autotest/temp/python23-zope27/lib/python/OFS/ Traversable.py, line 180, in unrestrictedTraverse o = guarded_getattr(object, name, M) AttributeError: manage_addFile On 15. Feb 2005, at 21:29, Stefan H. Holek wrote: Most excellent fix, thanks! Stefan On 14. Feb 2005, at 20:24, Jim Fulton wrote: Tres Seaver wrote: Jim and I worked on an alternative fix today -- he will be checking it in to your branch shortly, including modifying cAccessControl. Done. Jim -- Software Engineering is Programming when you can't. --E. W. Dykstra ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: guarded_getattr
This is a spurious failure. Someone forgot to check in a fix to this test that I checked in on the branch. Jim Stefan H. Holek wrote: Oops, I just noticed there is a CMFCore test failing now, all branches... == ERROR: test_move_cant_create_target_metatype_not_allowed (CMFCore.tests.test_PortalFolder.PortalFolderCopySupportTests) -- Traceback (most recent call last): File /Users/stefan/autotest/temp/python23-zope27-cmf15/Products/CMFCore/ tests/test_PortalFolder.py, line 1021, in test_move_cant_create_target_metatype_not_allowed , ce_regex='Insufficient Privileges' File /Users/stefan/autotest/temp/python23-zope27-cmf15/Products/CMFCore/ tests/test_PortalFolder.py, line 855, in _assertCopyErrorUnauth callable( *args, **kw ) File /Users/stefan/autotest/temp/python23-zope27/lib/python/OFS/ CopySupport.py, line 160, in manage_pasteObjects self._verifyObjectPaste(ob, validate_src=op+1) File /Users/stefan/autotest/temp/python23-zope27-cmf15/Products/CMFCore/ PortalFolder.py, line 533, in _verifyObjectPaste PortalFolder.inheritedAttribute( File /Users/stefan/autotest/temp/python23-zope27/lib/python/OFS/ CopySupport.py, line 358, in _verifyObjectPaste method = self.restrictedTraverse(method_name) File /Users/stefan/autotest/temp/python23-zope27/lib/python/OFS/ Traversable.py, line 204, in restrictedTraverse return self.unrestrictedTraverse(path, default, restricted=1) File /Users/stefan/autotest/temp/python23-zope27/lib/python/OFS/ Traversable.py, line 180, in unrestrictedTraverse o = guarded_getattr(object, name, M) AttributeError: manage_addFile On 15. Feb 2005, at 21:29, Stefan H. Holek wrote: Most excellent fix, thanks! Stefan On 14. Feb 2005, at 20:24, Jim Fulton wrote: Tres Seaver wrote: Jim and I worked on an alternative fix today -- he will be checking it in to your branch shortly, including modifying cAccessControl. Done. Jim -- Software Engineering is Programming when you can't. --E. W. Dykstra ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope ) -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: guarded_getattr
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: | This is a spurious failure. Someone forgot to check in | a fix to this test that I checked in on the branch. | | Jim | | Stefan H. Holek wrote: | | Oops, I just noticed there is a CMFCore test failing now, all | branches... This test is isomorphic to the fixed one in OFS.tests.testCopySupport. I will repair it. Tres. - -- === Tres Seaver[EMAIL PROTECTED] Zope Corporation Zope Dealers http://www.zope.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCFP4yGqWXf00rNCgRAs7NAJ9AaFDX6pb5uFjyS0ZiOkx0h91GLQCeK40N deZyPkbsCGNRnnycFH0/ujI= =SelV -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Patch for attribute permisions problems in Zope 2.7.3
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Santi Camps wrote: | We have been written last week about some attribute permission problems | with Zope 2.7.3 beta due to a patch applied by Tres. | First of all, Tres, apologies for my too fast written test case and my | too late test of Zope 2.7.3. Now, with some more time, I've tested and | debugged on Zope 2.7.3 and found exactly what's happen. | Supose we have a structure of objects like this:A.__of__(B) | A inherits from Acquisition.Implicit, has security assertions, but has | not __allow_access_to_unprotected_subojects__ | We want to access, from a Zope Page Template, an attribute of B that | is not present in A | Accessing B.our_attribute attribute works fine. But accessing | A.__of__(B).our_attribute fails, and should work. | | The problem is the call to validate done in guarded_getattr method | of ImplPython.py. The actual call is if validate(inst, inst, name, | v), but the validate function says: | | Arguments: |accessed -- the object that was being accessed |container -- the object the value was found in |name -- The name used to access the value |value -- The value retrieved though the access. |roles -- The roles of the object if already known. | | Now, accessed and container are always the same, and in some cases | should be different. I attach a patch to solve this case that works | for me. I'm not sure if my code is the best way to solve the problem | but, as I said, it seems to work fine. | Of course, If the patch is accepted, the same change should be done in | the C version. Jim and I worked through this, and ended up putting back the use of 'aq_acquire' to do the validation, precisely becuase *it* knows what the real container is (from guarded_getattr, you have to guess). Please verify that the head of the 2.7 branch resolves the issues you found. Thanks very much for your work on this issue. I'm sorry I let it slide so long, Tres. - -- === Tres Seaver[EMAIL PROTECTED] Zope Corporation Zope Dealers http://www.zope.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD4DBQFCFWSEGqWXf00rNCgRAtxAAJisR/4jFULrp9Lyd9mvubtF1y8MAJsE0/Vy NTXbqXc+olXYl3SVxiWW8w== =1hOE -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )