Change in vdsm[master]: tests: Add Patch class for fixture monkey patching

danken at redhat.com danken at redhat.com
Sat Oct 12 16:23:59 UTC 2013


Dan Kenigsberg has posted comments on this change.

Change subject: tests: Add Patch class for fixture monkey patching
......................................................................


Patch Set 2:

(2 comments)

....................................................
File tests/monkeypatch.py
Line 30: #
Line 31: # class TestSomething():
Line 32: #
Line 33: #     def setUp(self):
Line 34: #         self.patch = monkeypatch.Patch([
A class decorator could also help avoid initializing a data member out of __init__.
Line 35: #             (subprocess, 'Popen', lambda x: None),
Line 36: #             (os, 'chown', lambda *x: 0)
Line 37: #         ])
Line 38: #


....................................................
File tests/monkeypatchTests.py
Line 16: # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
Line 17: #
Line 18: # Refer to the README and COPYING files for full details of the license
Line 19: #
Line 20: 
I love tests and examples, but this test is as complex as the tested feature, which is to be used only in other tests.
Line 21: from testrunner import VdsmTestCase
Line 22: 
Line 23: import monkeypatch
Line 24: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Idd419377be951635fe7d10cb21c0d1195e88cf8d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list