On 23 Mar 2007 12:19:15 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > "killkolor" <[EMAIL PROTECTED]> wrote: > >> I have a unittest framework that tests a single function that in turn >> works with files (takes input and outputs in the same file, no return >> values). > > I would want to split that function into two: > > a) one which does the processing, but not working with a file,
Better to make it work with "a file", in the sense that it works with file-like objects so you can feed and leech it using StringIO. > b) and one which handles reading and calls the processing function and then > writes the file. The function it calls would be passed in as an optional > parameter and defaults to function (a) /Jorgen -- // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu \X/ snipabacken.dyndns.org> R'lyeh wgah'nagl fhtagn! -- http://mail.python.org/mailman/listinfo/python-list