def testIterator1(self): '''Test sample Iterator class''' context = harness1() it = TALES.Iterator('name', (1,), context) context._assert_('setLocal', 'name', 1) assert it.next() and not it.next(), "Single-element iterator" context._complete_()
def testIterator2(self): '''Test sample Iterator class''' context = harness1() it = TALES.Iterator('text', 'text', context) for c in 'text': context._assert_('setLocal', 'text', c) for c in 'text': assert it.next(), "Multi-element iterator" assert not it.next(), "Multi-element iterator" context._complete_()
def testIterator0(self): '''Test sample Iterator class''' context = harness1() it = TALES.Iterator('name', (), context) assert not it.next(), "Empty iterator" context._complete_()