"Virtual" file system mock object - replacing stuff in __builtins__

Lothar Scholz llothar at web.de
Tue Mar 9 14:40:34 CET 2004


Ralf Muschall <ralf at tecont.de> wrote in message news:<84hdwz0y4k.fsf at tecont.de>...

> It might fail in two cases that come to my mind:
> 
> 1. "/lost/file1.mp3": ((33188, 884738L, 774L, 1, 0, 0, 1463L,
>      1054331223, 991209287, 1054333751), "File content"),
> 
>    being replaced by
> 
>    "/lost/file1.iso": ((33188, 884738L, 774L, 1, 0, 0, 2147483648L,
>      1054331223, 991209287, 1054333751), "File content"),
> 
>    (with stat(thingy)[6] being the size)

Okay, but it with all tests the overall principle is make test data as
small as possible.

> 2. if absolute pathnames are relevant (e.g. for OS administration).

One of the main results of test driven development is that maybe an
architecture must be changed to support unit tests. And having
absolute fixed path names is as bad as adding literals for
host,port,username,password of a database connection.



More information about the Python-list mailing list