Class
zope.configuration.fields.GlobalInterface

An interface that can be accessed from a module.

First, we need to set up a stub name resolver:

>>> class Foo(object): pass
>>> from zope.interface import Interface
>>> class IFoo(Interface): pass
>>> d = {'Foo': Foo, 'IFoo': IFoo}
>>> class fakeresolver(dict):
...     def resolve(self, n):
...         return self[n]
>>> fake = fakeresolver(d)

Now verify constraints are checked correctly.

>>> g = GlobalInterface()
>>> gg = g.bind(fake)
>>> gg.fromUnicode('IFoo')
<InterfaceClass zope.configuration.fields.IFoo>
>>> gg.fromUnicode('  IFoo  ')
<InterfaceClass zope.configuration.fields.IFoo>
>>> gg.fromUnicode('Foo')
Traceback (most recent call last):
...
WrongType: An interface is required

Base classes

Implemented Interfaces

Attributes/Properties

Methods

Known Subclasses