testing -- what to do for testing code with behaviour dependant upon which files exist?

Jeremy Bowers jerf at jerf.org
Sat Apr 2 19:28:10 EST 2005


On Sat, 02 Apr 2005 15:30:13 -0500, Brian van den Broek wrote:
> So, how does one handle such cases with tests?

When I had a similar situation, I created a directory for testing that was
in a known state, and tested on that. If you can test based on a relative
directory, that should work OK.

Non-existant paths shouldn't be too hard to come up with; hardcoding a
constant relative dir of
"THISDIRECTORYCANTPOSSIBLYEXISTANDIFITDOESYOURENUTS" ought to do OK.






More information about the Python-list mailing list