[Subversion] / PyProtocols / src / protocols / tests / test_advice.py  

Diff of /PyProtocols/src/protocols/tests/test_advice.py

Parent Directory | Revision Log

version 27, Mon May 26 20:46:56 2003 UTC version 28, Mon May 26 22:05:05 2003 UTC
Line 3 
Line 3 
 from unittest import TestCase, makeSuite, TestSuite  from unittest import TestCase, makeSuite, TestSuite
 from protocols.advice import *  from protocols.advice import *
 import sys  import sys
   from types import InstanceType
   
   
   def ping(log, value):
   
       def pong(klass):
           log.append((value,klass))
           return [klass]
   
       addClassAdvisor(pong)
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
 class SuperTest(TestCase):  class SuperTest(TestCase):
Line 39 
Line 73 
         assert ClassOfSubMeta().foo(1)==2          assert ClassOfSubMeta().foo(1)==2
   
   
   
   
   
   
   
   
   
     def checkPropSuper(self):      def checkPropSuper(self):
   
         class Base(object):          class Base(object):
Line 108 
Line 149 
             assert d is globals()              assert d is globals()
   
   
 def ping(log, value):  
   
     def pong(klass):  
         log.append((value,klass))  
         return [klass]  
   
     addClassAdvisor(pong)  
   
   
   
   
   
   
   
   
   
   
   class MROTests(TestCase):
   
       def checkStdMRO(self):
           class foo(object): pass
           class bar(foo): pass
           class baz(foo): pass
           class spam(bar,baz): pass
           assert getMRO(spam) is spam.__mro__
   
       def checkClassicMRO(self):
           class foo: pass
           class bar(foo): pass
           class baz(foo): pass
           class spam(bar,baz): pass
           basicMRO = [spam,bar,foo,baz,foo]
           assert list(getMRO(spam)) == basicMRO
           assert list(getMRO(spam,True)) == basicMRO+[InstanceType,object]
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
Line 214 
Line 296 
         assert determineMetaclass((meta,type))==metameta          assert determineMetaclass((meta,type))==metameta
   
   
   
   
   
 TestClasses = (  TestClasses = (
     SuperTest, AdviceTests, FrameInfoTest,      SuperTest, AdviceTests, FrameInfoTest, MROTests,
 )  )
   
 def test_suite():  def test_suite():
Line 241 
Line 326 
   
   
   
   
   
   


Generate output suitable for use with a patch program
Legend:
Removed from v.27  
changed lines
  Added in v.28

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help