test_base.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:letsdo 作者: clobrano 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号