Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize tests so that the functional tests are also discovered and run #6

Merged
merged 7 commits into from Jan 12, 2018

Conversation

gyst
Copy link
Contributor

@gyst gyst commented Jan 11, 2018

WIP

@janwijbrand
Copy link
Member

The test failure under pypy seems, maybe, to be related to how the security proxy should allow access to the __unicode__ attribute; this is apparently allowed in py27.

@jamadden
Copy link
Member

jamadden commented Jan 11, 2018

The test failure under pypy seems, maybe, to be related to how the security proxy should allow access to the __unicode__ attribute; this is apparently allowed in py27.

I would expect __unicode__ to be handled for pure-Python (as well as C) security proxies given zope.proxy 4.1.5 or newer. See zopefoundation/zope.security#10

@jamadden
Copy link
Member

I would expect unicode to be handled for pure-Python (as well as C) security proxies given zope.proxy 4.1.5 or newer.

I would expect that, but I would be wrong. The example test now fails:

In [10]: type(prox)
Out[10]: zope.security.proxy.ProxyPy

In [11]: unicode(prox)
---------------------------------------------------------------------------
ForbiddenAttribute                        Traceback (most recent call last)
<ipython-input-11-cb9aea809750> in <module>()
----> 1 unicode(prox)

//src/zope/security/proxy.pyc in _wrapper(self, *args, **kw)
     30         wrapped = super(PyProxyBase, self).__getattribute__('_wrapped')
     31         checker = super(PyProxyBase, self).__getattribute__('_checker')
---> 32         checker.check(wrapped, name)
     33         res = meth(self, *args, **kw)
     34         if not wrap_result:

//src/zope/security/checker.pyc in check(self, object, name)
    266         if name != '__iter__' or hasattr(object, name):
    267             __traceback_supplement__ = (TracebackSupplement, object)
--> 268             raise ForbiddenAttribute(name, object)
    269
    270     check_getattr = check # 'See IChecker'

ForbiddenAttribute: ('__unicode__', <__main__.CustomClass object at 0x10b6dd110>)

I'll take a look.

@janwijbrand
Copy link
Member

Thanks for your comment/assistance @jamadden !

@jamadden
Copy link
Member

The PyPy issues should be fixed by zopefoundation/zope.security#52

@jamadden
Copy link
Member

zope.security 4.2.2 has been released with the fix.

gyst added a commit to gyst/groktoolkit that referenced this pull request Jan 12, 2018
gyst added a commit to gyst/groktoolkit that referenced this pull request Jan 12, 2018
@gyst
Copy link
Contributor Author

gyst commented Jan 12, 2018

The pin here can be removed once zopefoundation/groktoolkit#6 is merged.

@janwijbrand
Copy link
Member

Thanks @jamadden for picking up the zope.security issue. It helps us out tremendously!

@janwijbrand janwijbrand merged commit 9631221 into zopefoundation:master Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants