예제 #1
0
파일: test.py 프로젝트: mindw/userconfig
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)
예제 #2
0
파일: test.py 프로젝트: mindw/userconfig
 def test_cleanup(self):
     conf = UserConfig('testconfig1', OPTIONS1)
     conf.cleanup()
     self.assertTrue( not os.path.isfile(conf.filename()) )
예제 #3
0
파일: test.py 프로젝트: mindw/userconfig
 def test_exist2(self):
     conf = UserConfig('testconfig2', OPTIONS2)
     self.assertTrue( os.path.isfile(conf.filename()) )