def ini2cleaner(filekey, do_next=True): ini = file(ini_fn, 'w') ini.write('[someapp]\n') ini.write('LangSecRef=3021\n') ini.write(filekey) ini.write('\n') ini.close() self.assertTrue(os.path.exists(ini_fn)) if do_next: return Winapp(ini_fn).get_cleaners().next() else: return Winapp(ini_fn).get_cleaners()
def ini2cleaner(self, body, do_next=True): """Write a minimal Winapp2.ini""" ini = open(self.ini_fn, 'w') ini.write('[someapp]\n') ini.write('LangSecRef=3021\n') ini.write(body) ini.write('\n') ini.close() self.assertExists(self.ini_fn) if do_next: return next(Winapp(self.ini_fn).get_cleaners()) else: return Winapp(self.ini_fn).get_cleaners()
def test_remote(self): """Test with downloaded file""" winapps = Winapp(get_winapp2()) for cleaner in winapps.get_cleaners(): self.run_all(cleaner, False)