Change in vdsm[master]: Add permutation feature to testing framework
zhshzhou at linux.vnet.ibm.com
zhshzhou at linux.vnet.ibm.com
Mon Sep 24 02:15:43 UTC 2012
Zhou Zheng Sheng has posted comments on this change.
Change subject: Add permutation feature to testing framework
......................................................................
Patch Set 13: Verified
Firstly fetch and checkout the patch, run through autobuild.sh.
Then I add another test as follow
@expandPermutations
class DevideTest(TestCaseBase):
DEVIDE_NUMBERS = [[1, 2], [5, 0], [4, 6], [1, 2, 3]]
@permutations(DEVIDE_NUMBERS)
def test(self, a, b):
r = a / b
print r
I expect there will be 4 tests generated, and the case "[5, 0]" will fail with dividing by zero, the case "[1, 2, 3]" will fail with wrong number of arguments, the other ones will succeed.
./run_test_local.sh gives the following result.
DevideTest
test(a=1, b=2) OK
test(a=1, b=2, r=3) ERROR
test(a=4, b=6) OK
test(a=5, b=0) ERROR
======================================================================
ERROR: test(a=1, b=2, r=3) (permutationTests.DevideTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/edward/src/vdsm-sheng/tests/testrunner.py", line 38, in wrapper
return f(self, *args)
TypeError: test() takes exactly 3 arguments (4 given)
======================================================================
ERROR: test(a=5, b=0) (permutationTests.DevideTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/edward/src/vdsm-sheng/tests/testrunner.py", line 38, in wrapper
return f(self, *args)
File "/home/edward/src/vdsm-sheng/tests/permutationTests.py", line 69, in test
r = a / b
ZeroDivisionError: integer division or modulo by zero
This behaviour is as expected.
--
To view, visit http://gerrit.ovirt.org/6244
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I26871027182a151fd63c381879e72255f6161695
Gerrit-PatchSet: 13
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Adam Litke <agl at us.ibm.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ewoud Kohl van Wijngaarden <ewoud at kohlvanwijngaarden.nl>
Gerrit-Reviewer: Peter V. Saveliev <peet at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list