#NEWLINE# def test_ObjectSpecification( self ) : #NEWLINE# #INDENT# c = C ( ) #NEWLINE# directlyProvides ( c , I4 ) #NEWLINE# self . assertEqual ( [ i . getName ( ) for i in providedBy ( c ) ] , [ 'I4' , 'I31' , 'I1' , 'I2' ] ) #NEWLINE# self . assertEqual ( [ i . getName ( ) for i in providedBy ( c ) . flattened ( ) ] , [ 'I4' , 'I31' , 'I3' , 'I1' , 'I2' , 'Interface' ] ) #NEWLINE# self . failUnless ( ( I1 in providedBy ( c ) ) ) #NEWLINE# self . failIf ( ( I3 in providedBy ( c ) ) ) #NEWLINE# self . failUnless ( providedBy ( c ) . extends ( I3 ) ) #NEWLINE# self . failUnless ( providedBy ( c ) . extends ( I31 ) ) #NEWLINE# self . failIf ( providedBy ( c ) . extends ( I5 ) ) #NEWLINE# class COnly ( A , B ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# classImplementsOnly ( COnly , I31 ) #NEWLINE# class D ( COnly ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# classImplements ( D , I5 ) #NEWLINE# classImplements ( D , I5 ) #NEWLINE# c = D ( ) #NEWLINE# directlyProvides ( c , I4 ) #NEWLINE# self . assertEqual ( [ i . getName ( ) for i in providedBy ( c ) ] , [ 'I4' , 'I5' , 'I31' ] ) #NEWLINE# self . assertEqual ( [ i . getName ( ) for i in providedBy ( c ) . flattened ( ) ] , [ 'I4' , 'I5' , 'I31' , 'I3' , 'Interface' ] ) #NEWLINE# self . failIf ( ( I1 in providedBy ( c ) ) ) #NEWLINE# self . failIf ( ( I3 in providedBy ( c ) ) ) #NEWLINE# self . failUnless ( providedBy ( c ) . extends ( I3 ) ) #NEWLINE# self . failIf ( providedBy ( c ) . extends ( I1 ) ) #NEWLINE# self . failUnless ( providedBy ( c ) . extends ( I31 ) ) #NEWLINE# self . failUnless ( providedBy ( c ) . extends ( I5 ) ) #NEWLINE# class COnly ( A , B ) : #NEWLINE# #INDENT# __implemented__ = I31 #NEWLINE# #UNINDENT# class D ( COnly ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# classImplements ( D , I5 ) #NEWLINE# classImplements ( D , I5 ) #NEWLINE# c = D ( ) #NEWLINE# directlyProvides ( c , I4 ) #NEWLINE# self . assertEqual ( [ i . getName ( ) for i in providedBy ( c ) ] , [ 'I4' , 'I5' , 'I31' ] ) #NEWLINE# self . assertEqual ( [ i . getName ( ) for i in providedBy ( c ) . flattened ( ) ] , [ 'I4' , 'I5' , 'I31' , 'I3' , 'Interface' ] ) #NEWLINE# self . failIf ( ( I1 in providedBy ( c ) ) ) #NEWLINE# self . failIf ( ( I3 in providedBy ( c ) ) ) #NEWLINE# self . failUnless ( providedBy ( c ) . extends ( I3 ) ) #NEWLINE# self . failIf ( providedBy ( c ) . extends ( I1 ) ) #NEWLINE# self . failUnless ( providedBy ( c ) . extends ( I31 ) ) #NEWLINE# self . failUnless ( providedBy ( c ) . extends ( I5 ) )