示例#1
0
             def worker():
                 verified = ImageVerifier.verify_gen(basedir, exts)
                 
                 for imgdir, paths in verified:
                     if self.abort:
                         self.console.write('\nABORTED')
                         return
                     
                     self.corrupt_images += paths
                     msg = self.get_report(imgdir, paths)
                     self.console.write(msg)
 
                 msg = self.get_final_report()
                 self.console.write(msg)
                 
                 self.run_btn['text'] = "Run"
                 self.abort = True
    def test_bad_images_identified_in_sub_dirs(self, imgdir):
        base = os.path.dirname(str(imgdir))
        data = [d for d in ImageVerifier.verify_gen(base, ['.TXT'])
                if d[0].endswith('/images')]

        assert len(data[0][1]) == 5
    def test_good_images_identified(self, imgdir):
        data = [d for d in ImageVerifier.verify_gen(imgdir, ['.JPG'])]

        assert len(data[0][1]) == 0
    def test_sub_dirs_checked(self, imgdir):
        base = os.path.dirname(str(imgdir))
        data = [d for d in ImageVerifier.verify_gen(base, ['.JPG'])]

        assert len(data) > 1
    def test_invalid_extensions_ignored(self, imgdir):
        data = [d for d in ImageVerifier.verify_gen(imgdir, ['.PNG'])]

        assert len(data[0][1]) == 0