Alon Bar-Lev has uploaded a new change for review.

Change subject: configNetworkTests: use context to manage monkey patches
......................................................................

configNetworkTests: use context to manage monkey patches

Easier to manage setup and cleanup at on place, then
trying to cleanup after a block of code, and catching
all exceptions.

Example of use:
 ---
def f():
    @contextlib.contextmanager
    def context():
        oldExists = os.path.exists
        os.path.exists = self._bondingOptExists
        try:
            yield {}
        finally:
            os.path.exists = oldExists

    with context() as value:
        logic
 ---

Change-Id: I2ecb4589f2edbf605e62a8963889d314c2535537
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M tests/configNetworkTests.py
1 file changed, 115 insertions(+), 98 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/6939/1
--
To view, visit http://gerrit.ovirt.org/6939
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ecb4589f2edbf605e62a8963889d314c2535537
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to