Art of Unit Testing: Part 2

Jesse F. W jessefw at loop.com
Fri Aug 24 20:51:07 CEST 2001


Dear Python-list-iners,
	I have another Testing related question.  How are unit tests done 
when the units to be tested get lots of information from nested 
objects, e.g. (in a method of a class to be tested):
if self.app.cnt_player.battle.kind=='stop':
how would this be tested?
	Should you simulate the parts of the app object that are needed? 
In that case, you have to update the tests when you use parts of the 
app object you did not use before.  Should you use a real app 
object?  Then you are not really doing _unit_ testing, and it would 
make running detailed tests very difficult?  Is there another solution 
that anyone knows about?

	Thank you all for your time,
		Jesse W




More information about the Python-list mailing list