MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / test_manual_converter

Function test_manual_converter

tests/test_check_object.py:197–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195
196@pytest.mark.compiled
197def test_manual_converter():
198 res = helper.run(
199 {
200 "DC_CODE": "xl = pd.ExcelFile('battledeath2.xlsx')",
201 "DC_SOLUTION": "xl = pd.ExcelFile('battledeath.xlsx')",
202 "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')",
203 "DC_SCT": """
204def my_converter(x): return(x.sheet_names)
205set_converter(key = "pandas.io.excel.ExcelFile", fundef = my_converter)
206Ex().check_object('xl').has_equal_value()
207""",
208 }
209 )
210 assert res["correct"]
211
212
213from pythonwhat.State import set_converter

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected