Esempio n. 1
0
 def test_generator_from_wikipedia(self):
     generator = GeneratorFromWikipedia()
     i = 0
     while i < 100:
         img, lbl = next(generator)
         self.assertTrue(img.size[1] == 32, "Shape is not right")
         i += 1
Esempio n. 2
0
 def test_generator_from_wikipedia_stops(self):
     generator = GeneratorFromWikipedia(count=1)
     next(generator)
     self.assertRaises(StopIteration, generator.next)