def conf_modified_by_user(version=None): conf = UserConfig('testconfig2', OPTIONS2, version=version) conf_file = file(conf.filename()) lines = conf_file.readlines() conf_file.close() lines = [line.replace('text text','other text') for line in lines] conf_file = file(conf.filename(),'w') conf_file.writelines(lines) conf_file.close() return UserConfig('testconfig2', OPTIONS2, version=version)
def test_cleanup(self): conf = UserConfig('testconfig1', OPTIONS1) conf.cleanup() self.assertTrue( not os.path.isfile(conf.filename()) )
def test_exist2(self): conf = UserConfig('testconfig2', OPTIONS2) self.assertTrue( os.path.isfile(conf.filename()) )