Let's say I have common code that I want to include in several unit
test.  Say

class Hello():

    def __init__(self,name='john'):
        self.name=name
        print('hello %s' % name)


Within a script, I could do something like:

p2 = g.findNodeAnywhere(c,'Common unit test code')
p3 = g.findNodeInTree(c,p2,'class Hello')
exec(p3.b+'\n')

Now the definition of class Hello is available to my script or unit
test(!)

Hello('Bob')

This is something that I've wanted to do forever.  It's almost too
easy.  I suppose it's a small security problem, but so is every other
@test node!

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to