def setUp(self):
test_configuration = \
'''DATA_DIRECTORY: ~/
TODO_FILE: ~/footodo.txt
TODO_START_TAG: ''
TODO_STOP_TAG: ''
'''
self.test_conf_file = os.path.expanduser(os.path.join('~', '.letsdo'))
self.user_conf_bak = os.path.expanduser(os.path.join('~', '.letsdo.bak'))
if os.path.exists(self.test_conf_file):
# Backup user configuration file
os.rename(self.test_conf_file, self.user_conf_bak)
# Create test configuration file
with open(self.test_conf_file, 'w') as fconf:
fconf.write(test_configuration)
self.conf = Configuration()
if os.path.exists(self.conf.data_fullpath):
os.remove(self.conf.data_fullpath)
if os.path.exists(self.conf.task_fullpath):
os.remove(self.conf.task_fullpath)
评论列表
文章目录