Change in vdsm[master]: v2v: tests: new testing class: MockVirConnectTests

shavivi at redhat.com shavivi at redhat.com
Wed Jan 13 08:13:33 UTC 2016


Shahar Havivi has posted comments on this change.

Change subject: v2v: tests: new testing class: MockVirConnectTests
......................................................................


Patch Set 2:

(3 comments)

https://gerrit.ovirt.org/#/c/51704/2/tests/v2vTests.py
File tests/v2vTests.py:

Line 450: 
Line 451:     def testListDefinedDomains(self):
Line 452:         vms = self._mock.listDefinedDomains()
Line 453:         self.assertEqual(len(vms),
Line 454:                          len([vm for vm in self._vms if not vm.isActive()]))
> Checking the number of vms is not enough, you also want to check that all t
we are returning vm names here,
are u suggesting to run on the _vms collection and match the name and check the status?
Line 455: 
Line 456:     def testListDomainsID(self):
Line 457:         vms = self._mock.listDomainsID()
Line 458:         self.assertEqual(len(vms),


Line 450: 
Line 451:     def testListDefinedDomains(self):
Line 452:         vms = self._mock.listDefinedDomains()
Line 453:         self.assertEqual(len(vms),
Line 454:                          len([vm for vm in self._vms if not vm.isActive()]))
> This duplicate the actual code, better do something like:
Done
Line 455: 
Line 456:     def testListDomainsID(self):
Line 457:         vms = self._mock.listDomainsID()
Line 458:         self.assertEqual(len(vms),


Line 455: 
Line 456:     def testListDomainsID(self):
Line 457:         vms = self._mock.listDomainsID()
Line 458:         self.assertEqual(len(vms),
Line 459:                          len([vm for vm in self._vms if vm.isActive()]))
> Same as previous test, do not duplicate the code.
Done
Line 460: 
Line 461:     def testlookupByName(self):
Line 462:         self._mock.lookupByName('RHEL_0')
Line 463: 


-- 
To view, visit https://gerrit.ovirt.org/51704
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If8a204b80297d95d380f1458b90eed1214997721
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list