File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -167,8 +167,6 @@ class AopProxy(object):
167
167
lookups are not intercepted, but instead fetched from the actual target object."""
168
168
169
169
def __init__ (self , target , interceptors ):
170
- if type (target ).__name__ != "instance" :
171
- raise Exception ("Target attribute must be an instance." )
172
170
self .target = target
173
171
if type (interceptors ) == list :
174
172
self .interceptors = interceptors
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ def testCreatingAopProxyFactoryAndAddingInterceptorToNewStyleClassProgammaticall
61
61
factory .target = NewStyleSampleService ()
62
62
factory .interceptors .append (WrappingInterceptor ())
63
63
service = factory .getProxy ()
64
- self .assertEquals ("<Wrapped>Alright !</Wrapped>" , service .doSomething ())
65
- self .assertEquals ("<Wrapped>You made it! => test</Wrapped>" , service .method ("test" ))
66
- self .assertEquals ("sample " , service .attribute )
64
+ self .assertEquals ("<Wrapped>Even better !</Wrapped>" , service .doSomething ())
65
+ self .assertEquals ("<Wrapped>You made it to a new style class ! => test</Wrapped>" , service .method ("test" ))
66
+ self .assertEquals ("new_sample " , service .attribute )
67
67
68
68
def testCreatingAProxyFactoryAndAddingAnInterceptorIoC (self ):
69
69
factory = self .appContext .get_object ("factory" )
You can’t perform that action at this time.
0 commit comments