Change in vdsm[master]: tests: split vm tests helpers in a module

nsoffer at redhat.com nsoffer at redhat.com
Mon Sep 8 18:31:55 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: tests: split vm tests helpers in a module
......................................................................


Patch Set 2:

(3 comments)

http://gerrit.ovirt.org/#/c/32650/2/tests/vmtestlib.py
File tests/vmtestlib.py:

Line 16: # along with this program; if not, write to the Free Software
Line 17: # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
Line 18: #
Line 19: # Refer to the README and COPYING files for full details of the license
Line 20: #
Can we rename this to vmfakelib ?

Everything here is a fake, and I find this name more funny than the vmtestlib ;-)

It would be even nicer if we could have:

    tests/virt/fake.py

And 

    from . import fake
    
    vm = fake.Vm()
Line 21: 
Line 22: from contextlib import contextmanager
Line 23: 
Line 24: import libvirt


Line 32: from testlib import namedTemporaryDir
Line 33: from monkeypatch import MonkeyPatchScope
Line 34: 
Line 35: 
Line 36: class ConnectionMock:
Lets unify the name in another patch to FakeConnection.
Line 37:     def __init__(self, *args):
Line 38:         pass
Line 39: 
Line 40:     def domainEventRegisterAny(self, *arg):


Line 137:             fake.conf['devices'] = [] if devices is None else devices
Line 138:             fake._guestCpuRunning = runCpu
Line 139:             if status is not None:
Line 140:                 fake._lastStatus = status
Line 141:             yield fake
This has no __exit__ code, so why it has to be a contextmanager?

Don't change it in this patch of course.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ied7bb1d38d3814c406a53e1b7dbcac34eb6ffeb7
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list