def test_removeSignFiles_on_signed_file(self): self.assertTrue(isSign(self.signed1, self.options_py)) count = 0 for filename in removeSignFiles(self.signed1, self.options_py): count += 1 self.assertEqual(count, 1) self.assertFalse(isSign(self.signed1, self.options_py))
def test_signFiles_on_dir_recursive(self): count = 0 for filename in removeSignFiles(self.testArea, self.options_py, True): count += 1 self.assertEqual(count, 2)
def test_removeSignFiles_on_unsigned_file(self): count = 0 for filename in removeSignFiles(self.unsigned1, self.options_py): count += 1 self.assertEqual(count, 0)
signrc = config.save_rc(config.gen_basic_rc()) if args.signrc: signrc = args.signrc if not os.path.isfile(signrc): raise IOError('file \'%s\' does not exist.' %(signrc)) else: signrc = config.find_rc() if not signrc: # hack for now print 'No Signrc found. Exiting.' sys.exit() sections = config.parse_rc(signrc) target= args.target if not os.path.exists(target): raise IOError('file/dir \'%s\' does not exist.' %(target)) if args.verbose: print format_signrc(signrc), '\n' count = 0 for section in sections: options = sections[section] for filename in main.removeSignFiles(target, options, args.recursive): count += 1 if args.verbose: print format(filename) if args.verbose: print gen_summary(count)