[node-patches] Change in ovirt-node[master]: fs: Introduce File and FakeFs

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue Jun 18 14:50:07 UTC 2013


Fabian Deutsch has submitted this change and it was merged.

Change subject: fs: Introduce File and FakeFs
......................................................................


fs: Introduce File and FakeFs

Two classes are added to allow unittesting without access to the
filesystem.
Previously unit tests were nearly impossible because of the many
informations which are retrieved from the filesystem (at runtime).
by wrapping the file i/o in a class a mocking framework (e.g.
python-mock) can be used to patch this file i/o class during unit tests
and redirect file i/o requests to a fake filesystem (e.g. an
in-memory fs).
FakeFs is a simple class implementing such a fake in-memory filesystem
which can be used during unit tests.

Change-Id: I7889240a956b359f2375955766f3cafcfbeaf0ee
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
Signed-off-by: Mike Burns <mburns at redhat.com>
---
M src/ovirt/node/utils/fs.py
1 file changed, 112 insertions(+), 0 deletions(-)

Approvals:
  Fabian Deutsch: Verified; Looks good to me, approved


-- 
To view, visit http://gerrit.ovirt.org/15509
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7889240a956b359f2375955766f3cafcfbeaf0ee
Gerrit-PatchSet: 13
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Michael Burns <mburns at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the node-patches mailing list