test_test_object.py 文件源码

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

项目:pythonwhat 作者: datacamp 项目源码 文件源码
def test_pass_1(self):
        self.data = {
            "DC_PEC": "import pandas as pd; from urllib.request import urlretrieve; urlretrieve('https://s3.amazonaws.com/assets.datacamp.com/production/course_998/datasets/battledeath.xlsx', 'battledeath.xlsx'); from urllib.request import urlretrieve; urlretrieve('https://s3.amazonaws.com/assets.datacamp.com/production/course_998/datasets/battledeath.xlsx', 'battledeath2.xlsx')",
            "DC_SOLUTION": "xl = pd.ExcelFile('battledeath.xlsx')",
            "DC_CODE": "xl = pd.ExcelFile('battledeath2.xlsx')",
            "DC_SCT": '''
def my_converter(x):
    return(x.sheet_names)
set_converter(key = "pandas.io.excel.ExcelFile", fundef = my_converter)
test_object('xl')
'''
        }
        sct_payload = helper.run(self.data)
        self.assertTrue(sct_payload['correct'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号