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

nsoffer at redhat.com nsoffer at redhat.com
Tue Jan 12 23:15:27 UTC 2016


Nir Soffer has posted comments on this change.

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


Patch Set 2:

(2 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()]))
> This duplicate the actual code, better do something like:
Checking the number of vms is not enough, you also want to check that all the vms are active.
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.
Same, checking the number of vms is not enough, you also want to check that all the vms are inactive.
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