Dan Kenigsberg has posted comments on this change. Change subject: itmap unit tests ......................................................................
Patch Set 4: I would prefer that you didn't submit this (2 inline comments) .................................................... File tests/miscTests.py Line 201: def dummy(arg): Line 202: time.sleep(1) Line 203: return arg Line 204: data = [1, 2, 3, 4] Line 205: self.assertEquals(list(misc.itmap(dummy, data, 3)).sort(), data.sort()) this always succeeds because None == None. [bla].sort() returns None. I'd suggest to use set() comparison. also, it would be cool to test that the time passed was no less than 2 seconds. Line 206: Line 207: def testMoreThreadsThanArgs(self): Line 208: data = [1, 2, 3] Line 209: self.assertEquals(list(misc.itmap(int, data, 80)).sort(), data.sort()) Line 209: self.assertEquals(list(misc.itmap(int, data, 80)).sort(), data.sort()) Line 210: Line 211: def testInvalidITMapParams(self): Line 212: data = 1 Line 213: self.assertRaises(Exception, misc.itmap(int, data, 0)) I think you've changed Exception to something more specific! Line 214: Line 215: Line 216: class RotateFiles(TestCaseBase): Line 217: def testNonExistingDir(self, persist=False): -- To view, visit http://gerrit.ovirt.org/8746 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I26e258a035f49a8ecd57e992b9a68b9475a58839 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Hunt Xu <[email protected]> Gerrit-Reviewer: Saggi Mizrahi <[email protected]> Gerrit-Reviewer: ShaoHe Feng <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
