Yaniv Bronhaim has uploaded a new change for review. Change subject: itmap unit tests ......................................................................
itmap unit tests Change-Id: I26e258a035f49a8ecd57e992b9a68b9475a58839 Signed-off-by: Yaniv Bronhaim <[email protected]> --- M tests/miscTests.py 1 file changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/8746/1 diff --git a/tests/miscTests.py b/tests/miscTests.py index 6339986..ebaeffc 100644 --- a/tests/miscTests.py +++ b/tests/miscTests.py @@ -196,6 +196,23 @@ self.fail("tmap did not throw an exception") +class ITMap(TestCaseBase): + def testMoreArgsThanThreads(self): + def dummy(arg): + time.sleep(1) + return arg + data = [1, 2, 3, 4] + self.assertEquals(list(misc.itmap(dummy, data, 3)), data) + + def testMoreThreadsThanArgs(self): + data = [1, 2, 3] + self.assertEquals(list(misc.itmap(int, data, 80)), data) + + def testInvalidITMapParams(self): + data = 1 + self.assertRaises(Exception, misc.itmap(int, data, 0)) + + class RotateFiles(TestCaseBase): def testNonExistingDir(self, persist=False): """ -- To view, visit http://gerrit.ovirt.org/8746 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26e258a035f49a8ecd57e992b9a68b9475a58839 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Yaniv Bronhaim <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
