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 <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Eduardo <[email protected]>
Gerrit-Reviewer: Gal Hammer <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches