Unit tests in Leo

Tomi Lindberg tomi.lindberg.NO_SPAM at pp.inet.fi.invalid
Sat Apr 9 00:20:27 EDT 2005


I'm quite (or very) new to both unit testing and Leo. I've 
been trying to get @test nodes to work without success so 
I'd like to have very simple example.

So, if I have a @file with the following content...

def divide_by_two(x):
     return x/2

...and I'd like to write a @test node that checks whether 
the function returns the right number ( like 
assertsEqual(divide_by_two(8), 4) ). Now, what should the 
@test node look like?

-- 
"Nowhere in me is the presence of god
Nor do I need him or want him around"

     Deicide - Standing in the Flames

---
If you wish to send me an e-mail, remove .NO_SPAM and 
.invalid from the address.



More information about the Python-list mailing list