Esempio n. 1
0
def runner(x, base, chunk):
    for i, j in itertools.zip_longest(divmod_iter_chunking(x, base, chunk),
                                      divmod_iter_basic(x, base)):
        if i is None:
            print("phooey")
        else:
            assert i == j
Esempio n. 2
0
def runner(x, base, chunk):
    try:
        zip_longest = itertools.izip_longest
    except AttributeError:
        zip_longest = itertools.zip_longest
    for i, j in zip_longest(divmod_iter_chunking(x, base, chunk), divmod_iter_basic(x, base)):
        if i is None:
            print("phooey")
        else:
            assert i == j
Esempio n. 3
0
 def _runner(self, x, base, chunk):
     try:
         zip_longest = itertools.izip_longest
     except AttributeError:
         zip_longest = itertools.zip_longest
     for i, j in zip_longest(divmod_iter_chunking(x, base, chunk),
                             divmod_iter_basic(x, base)):
         if i is None:
             print("phooey")
             self.fail()
         else:
             self.assertEqual(i, j)
Esempio n. 4
0
 def test_divmod_iter_basic(self):
     v = divmod_iter_basic(1234, 10)
     self.assertEqual([4, 3, 2, 1], list(v))
Esempio n. 5
0
def runner(x, base, chunk):
    for i, j in itertools.zip_longest(divmod_iter_chunking(x, base, chunk), divmod_iter_basic(x, base)):
        if i is None:
            print("phooey")
        else:
            assert i == j
Esempio n. 6
0
 def test_divmod_iter_basic(self):
     v = divmod_iter_basic(1234, 10)
     self.assertEqual([4, 3, 2, 1], list(v))