Has anyone released a Python "mock filesystem" for automated testing?

Mike Meyer mwm at mired.org
Fri Nov 5 08:04:34 CET 2004

Peter Hansen <peter at engcorp.com> writes:

> The term "mock filesystem" refers to code allowing unit
> or acceptance tests to create, read and write, and manipulate
> in other ways "virtual" files, without any actual disk
> access.  Everything is held in memory and therefore fast,
> without risk of damaging real files, and with none of the
> messiness of leftover files after testing.

Just out of curiosity, does your os implement some form of disk in
memory disk? Go to <URL: http://www.FreeBSD.org/cgi/man.cgi > and
search for either mfs or md for examples.

Second, consider using os.sep for path seperation, so that testing can
be done correctly for the OS the project is running on. Or possibly a
flag to indicate whether or not you want to use os.sep.

Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

More information about the Python-list mailing list