def testIteration(self):
        """testing the iteration protocol"""
        c = self.cursor()
        try:
            # first with a for loop
            cnt = 0
            c.execute("select * from zxtesting")
            for a in c:
                self.assertEquals(3, len(a))
                cnt += 1
            self.assertEquals(7, cnt)
            # then with a while loop
            cnt = 0
            c.execute("select * from zxtesting")
            while 1:
                try:
                    self.assertEquals(3, len(c.next()))
                except __HOLE__:
                    break
                cnt += 1
            self.assertEquals(7, cnt)
        finally:
            c.close()
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/zxjdbc/zxtest.py/zxAPITestCase.testIteration