Change in vdsm[master]: util: fix execCmd to accept tuples

nsoffer at redhat.com nsoffer at redhat.com
Sat Mar 29 23:29:20 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: util: fix execCmd to accept tuples
......................................................................


Patch Set 5:

(1 comment)

How to remove the boilerplate using permutations.

http://gerrit.ovirt.org/#/c/26070/5/tests/utilsTests.py
File tests/utilsTests.py:

Line 444:             self.fail("Wrong exception was raised")
Line 445: 
Line 446:         self.fail("Exception was not raised")
Line 447: 
Line 448: 
We can remove all the boilerplate using permutaions.

    from testrunner import permutations, expandPermutations                       
    ...
    @expandPermutations
    class ExecCmdTest(TestCaseBase):

        @permutations([tuple, list, iter])
        def testDefaults(self, what):
            rc, out, _ = utils.execCmd(what(('echo', 'hello world')))
            self.assertEquals(rc, 0)
            self.assertEquals(out[0], 'hello world')

See also tests/functional/storageTests.py
Line 449: class ExecCmdTest(TestCaseBase):
Line 450: 
Line 451:     def checkNormal(self, what):
Line 452:         (rc, out, _) = utils.execCmd(what(('echo', 'hello world')))


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8d1269d9a26b1fef1552976ae626cf4596471283
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei 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