Dan Kenigsberg has posted comments on this change.
Change subject: configNetworkTests: use context to manage monkey patches ......................................................................
Patch Set 3: I would prefer that you didn't submit this
(7 inline comments)
Thanks! I think we can make it even cooler.
.................................................... File tests/configNetworkTests.py Line 157: Just an idea: it would be even cooler if you write a function decorator that does the monkey-patching:
@MonkeyPatch(os.path, 'exists', self._bondingOptExists) @MonkeyPatch(some, other, patch) def testCase():
Line 163: ]): I find this indentation awkward.
Line 314: # a rather ugly stubbing it is quite beautiful now! I think we can drop the comment.
Line 338: (netinfo, 'NET_CONF_BACK_DIR', os.path.join(self._tempdir, 'netback')), long line
.................................................... File tests/monkeypatch.py Line 40: for f in what: a more pythonic way to write this is
for module, name, func in what:
though I prefer (module, attr, value)
Line 43: func=f[2] this value is not necessarily a func.
Line 47: yield {} what's the point of this empty dict?
-- To view, visit http://gerrit.ovirt.org/6939 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2ecb4589f2edbf605e62a8963889d314c2535537 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo ewarszaw@redhat.com Gerrit-Reviewer: Gal Hammer ghammer@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com