#NEWLINE# def test_directlyProvides( self ) : #NEWLINE# #INDENT# class IA1 ( Interface ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class IA2 ( Interface ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class IB ( Interface ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class IC ( Interface ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class A ( Odd ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# classImplements ( A , IA1 , IA2 ) #NEWLINE# class B ( Odd ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# classImplements ( B , IB ) #NEWLINE# class C ( A , B ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# classImplements ( C , IC ) #NEWLINE# ob = C ( ) #NEWLINE# directlyProvides ( ob , I1 , I2 ) #NEWLINE# self . failUnless ( ( I1 in providedBy ( ob ) ) ) #NEWLINE# self . failUnless ( ( I2 in providedBy ( ob ) ) ) #NEWLINE# self . failUnless ( ( IA1 in providedBy ( ob ) ) ) #NEWLINE# self . failUnless ( ( IA2 in providedBy ( ob ) ) ) #NEWLINE# self . failUnless ( ( IB in providedBy ( ob ) ) ) #NEWLINE# self . failUnless ( ( IC in providedBy ( ob ) ) ) #NEWLINE# directlyProvides ( self , ( directlyProvidedBy ( ob ) - I2 ) ) #NEWLINE# self . failUnless ( ( I1 in providedBy ( ob ) ) ) #NEWLINE# self . failIf ( ( I2 in providedBy ( ob ) ) ) #NEWLINE# self . failIf ( ( I2 in providedBy ( ob ) ) ) #NEWLINE# directlyProvides ( ob , directlyProvidedBy ( ob ) , I2 ) #NEWLINE# self . failUnless ( ( I2 in providedBy ( ob ) ) )