Change in vdsm[master]: util: fix execCmd to accept tuples
nsoffer at redhat.com
nsoffer at redhat.com
Tue Apr 1 09:20:41 UTC 2014
Nir Soffer has posted comments on this change.
Change subject: util: fix execCmd to accept tuples
......................................................................
Patch Set 6:
(1 comment)
Final touches
http://gerrit.ovirt.org/#/c/26070/6/tests/utilsTests.py
File tests/utilsTests.py:
Line 449:
Line 450: @expandPermutations
Line 451: class ExecCmdTest(TestCaseBase):
Line 452:
Line 453: @permutations([[tuple], [list], [iter]])
Nice - now lets remove the duplication - we use the same permutations for all tests here.
class ExecCmdTest(TestCaseBase):
CMD_TYPES = (tuple,), (list,), (iter,)
@permutations(CMD_TYPES)
def testIoClass(self, cmd):
rc, out, _ = utils.execCmd(cmd(('echo', 'hello world')))
...
Notes:
- cmd is more clear then what - we are testing different types of cmd argument for execCmd.
- Use immutable values for stuff that is not intended to be modified
Line 454: def testNormal(self, what):
Line 455: rc, out, _ = utils.execCmd(what(('echo', 'hello world')))
Line 456: self.assertEquals(rc, 0)
Line 457: self.assertEquals(out[0], '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: 6
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