test_static_files.py 文件源码

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

项目:jarbas 作者: datasciencebr 项目源码 文件源码
def test_ceap_datasets(self, mock_urlretrieve):

        # backup existing file if exists
        original = path.join(settings.CORE_STATIC_DIR, 'ceap-datasets.html')
        backup = original + '.bkp'
        if path.exists(original):
            rename(original, backup)

        # test
        self.assertEqual(None, finders.find('ceap-datasets.html'))
        call_command('ceapdatasets', stdout=StringIO())
        self.assertTrue(finders.find('ceap-datasets.html'))

        # restore existing file backup
        if path.exists(backup):
            remove(backup, original)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号