Exemplo n.º 1
0
    def testClassImplements(self):
        from reqs.zope.interface.tests.unitfixtures import A
        from reqs.zope.interface.tests.unitfixtures import B
        from reqs.zope.interface.tests.unitfixtures import C
        from reqs.zope.interface.tests.unitfixtures import D
        from reqs.zope.interface.tests.unitfixtures import E
        from reqs.zope.interface.tests.unitfixtures import I1
        from reqs.zope.interface.tests.unitfixtures import I2
        from reqs.zope.interface.tests.unitfixtures import IC
        self.assert_(IC.implementedBy(C))

        self.assert_(I1.implementedBy(A))
        self.assert_(I1.implementedBy(B))
        self.assert_(not I1.implementedBy(C))
        self.assert_(I1.implementedBy(D))
        self.assert_(I1.implementedBy(E))

        self.assert_(not I2.implementedBy(A))
        self.assert_(I2.implementedBy(B))
        self.assert_(not I2.implementedBy(C))

        # No longer after interfacegeddon
        # self.assert_(not I2.implementedBy(D))

        self.assert_(not I2.implementedBy(E))
Exemplo n.º 2
0
    def testClassImplements(self):
        from reqs.zope.interface.tests.unitfixtures import A
        from reqs.zope.interface.tests.unitfixtures import B
        from reqs.zope.interface.tests.unitfixtures import C
        from reqs.zope.interface.tests.unitfixtures import D
        from reqs.zope.interface.tests.unitfixtures import E
        from reqs.zope.interface.tests.unitfixtures import I1
        from reqs.zope.interface.tests.unitfixtures import I2
        from reqs.zope.interface.tests.unitfixtures import IC
        self.assert_(IC.implementedBy(C))

        self.assert_(I1.implementedBy(A))
        self.assert_(I1.implementedBy(B))
        self.assert_(not I1.implementedBy(C))
        self.assert_(I1.implementedBy(D))
        self.assert_(I1.implementedBy(E))

        self.assert_(not I2.implementedBy(A))
        self.assert_(I2.implementedBy(B))
        self.assert_(not I2.implementedBy(C))

        # No longer after interfacegeddon
        # self.assert_(not I2.implementedBy(D))

        self.assert_(not I2.implementedBy(E))
Exemplo n.º 3
0
    def testObjectImplements(self):
        from reqs.zope.interface.tests.unitfixtures import A
        from reqs.zope.interface.tests.unitfixtures import B
        from reqs.zope.interface.tests.unitfixtures import C
        from reqs.zope.interface.tests.unitfixtures import D
        from reqs.zope.interface.tests.unitfixtures import E
        from reqs.zope.interface.tests.unitfixtures import I1
        from reqs.zope.interface.tests.unitfixtures import I2
        from reqs.zope.interface.tests.unitfixtures import IC
        self.assert_(IC.providedBy(C()))

        self.assert_(I1.providedBy(A()))
        self.assert_(I1.providedBy(B()))
        self.assert_(not I1.providedBy(C()))
        self.assert_(I1.providedBy(D()))
        self.assert_(I1.providedBy(E()))

        self.assert_(not I2.providedBy(A()))
        self.assert_(I2.providedBy(B()))
        self.assert_(not I2.providedBy(C()))

        # Not after interface geddon
        # self.assert_(not I2.providedBy(D()))

        self.assert_(not I2.providedBy(E()))
Exemplo n.º 4
0
    def testObjectImplements(self):
        from reqs.zope.interface.tests.unitfixtures import A
        from reqs.zope.interface.tests.unitfixtures import B
        from reqs.zope.interface.tests.unitfixtures import C
        from reqs.zope.interface.tests.unitfixtures import D
        from reqs.zope.interface.tests.unitfixtures import E
        from reqs.zope.interface.tests.unitfixtures import I1
        from reqs.zope.interface.tests.unitfixtures import I2
        from reqs.zope.interface.tests.unitfixtures import IC
        self.assert_(IC.providedBy(C()))

        self.assert_(I1.providedBy(A()))
        self.assert_(I1.providedBy(B()))
        self.assert_(not I1.providedBy(C()))
        self.assert_(I1.providedBy(D()))
        self.assert_(I1.providedBy(E()))

        self.assert_(not I2.providedBy(A()))
        self.assert_(I2.providedBy(B()))
        self.assert_(not I2.providedBy(C()))

        # Not after interface geddon
        # self.assert_(not I2.providedBy(D()))

        self.assert_(not I2.providedBy(E()))