How to detect typos in Python programs

Steven Taschuk staschuk at telusplanet.net
Fri Jul 25 23:35:58 CEST 2003


Quoth Manish Jethani:
  [...]
> Actually I am writing a client app for a proprietary service.
> The server is not under my control, so I can't make it behave in
> a way that will cause every part of my client code to be tested.
> As I mentioned, for example, I have a function to handle a
> server-disconnect.  But the server rarely ever disconnects of
> its own, so the function never gets called in reality.  Can I
> unit test this function easily?

Mock objects are the usual approach to this kind of problem.
(Google can tell you more.)

-- 
Steven Taschuk                                     staschuk at telusplanet.net
Receive them ignorant; dispatch them confused.  (Weschler's Teaching Motto)





More information about the Python-list mailing list