Skip to content

Commit

Permalink
100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Apr 22, 2017
1 parent 22eab46 commit c382ffa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
7 changes: 1 addition & 6 deletions src/zope/__init__.py
@@ -1,7 +1,2 @@
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
7 changes: 1 addition & 6 deletions src/zope/app/__init__.py
@@ -1,7 +1,2 @@
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
18 changes: 17 additions & 1 deletion src/zope/app/content/__init__.py
Expand Up @@ -106,7 +106,23 @@ def queryType(object, interface):

def queryContentType(object):
"""Returns the interface implemented by object which implements
`IContentType`."""
:class:`zope.app.content.interfaces.IContentType`.
>>> from zope.interface import Interface, implementer, directlyProvides
>>> class I(Interface):
... pass
>>> directlyProvides(I, IContentType)
>>> @implementer(I)
... class C(object):
... pass
>>> obj = C()
>>> c1_ctype = queryType(obj, IContentType)
>>> c1_ctype.__name__
'I'
"""
return queryType(object, IContentType)


Expand Down

0 comments on commit c382ffa

Please sign in to comment.