Beispiel #1
0
 def testFailure(self):
     self.assertRaises(ZeroDivisionError, list, flow.Block(badgen()))
     self.assertEqual(['x',ZeroDivisionError],
                      list(flow.Block(badgen(),ZeroDivisionError)))
     self.assertEqual(['x',ZeroDivisionError],
                      list(flow.Block(flow.wrap(badgen()),
                                                ZeroDivisionError)))
Beispiel #2
0
 def __iter__(self):
     self.title = flow.wrap(['Title'])
     self.lst   = flow.wrap(producer())
     self.next = self.yield_title
     return self
Beispiel #3
0
 def __iter__(self):
     self.lst   = flow.wrap(slowlist([1,2,3]))
     self.nam   = flow.wrap(slowlist(_onetwothree))
     self.next = self.yield_lst
     return self
Beispiel #4
0
 def testBuildList(self):
     src = flow.wrap([1,2,3])
     out = flow.Block(buildlist(src)).next()
     self.assertEquals(out,[1,2,3])
Beispiel #5
0
 def testNotReady(self):
     x = flow.wrap([1,2,3])
     self.assertRaises(flow.NotReadyError,x.next)