def test_coverage(self):
     d = {}
     l = range(100)
     def f(x):
         d[x]=x**2
     handythread.foreach(f, l)
     for i in l:
         self.assertEqual(d[i],i**2)
Beispiel #2
0
    def test_coverage(self):
        d = {}
        l = range(100)

        def f(x):
            d[x] = x**2

        handythread.foreach(f, l)
        for i in l:
            self.assertEqual(d[i], i**2)
Beispiel #3
0
 def test_return_1(self):
     l = range(100)
     r = handythread.foreach(lambda x: x**2, l, return_=True, threads=1)
     for i in range(len(l)):
         self.assertEqual(l[i]**2, r[i])
 def test_return_1(self):
     l = range(100)
     r = handythread.foreach(lambda x: x**2, l, return_=True, threads=1)
     for i in range(len(l)):
         self.assertEqual(l[i]**2,r[i])