[TIP] mocking a file in /proc

David Palao dpalao.python at gmail.com
Tue Jan 24 05:51:34 PST 2017


Hello,
I am writing a program that does something based on information read
from /proc (the target OS is linux). But I have some problems figuring
out how to mock the /proc filesystem, or at least, some files in it.

The rationale is that I want to change some files inside /proc to
simulate different configurations of the host computer so that I can
run my functional tests against those different configurations.

I was thinking in using docker for this task. But
1) this is offtopic here :)
and
2) I would like to learn what is the standard way to deal with such
situations. If there is a "standard way" at all... I mean, what am I
supposed to do from the point of view of TDD?

I would appreciate if someone with experience in such problems could
share some advice.

Best,


David



More information about the testing-in-python mailing list