Basic %%writefile with embedded double quotes
()
| 1310 | |
| 1311 | @dec.skip_win32 |
| 1312 | def test_file_double_quote(): |
| 1313 | """Basic %%writefile with embedded double quotes""" |
| 1314 | ip = get_ipython() |
| 1315 | with TemporaryDirectory() as td: |
| 1316 | fname = os.path.join(td, '"file1"') |
| 1317 | ip.run_cell_magic( |
| 1318 | "writefile", |
| 1319 | fname, |
| 1320 | "\n".join( |
| 1321 | [ |
| 1322 | "line1", |
| 1323 | "line2", |
| 1324 | ] |
| 1325 | ), |
| 1326 | ) |
| 1327 | s = Path(fname).read_text(encoding="utf-8") |
| 1328 | assert "line1\n" in s |
| 1329 | assert "line2" in s |
| 1330 | |
| 1331 | |
| 1332 | def test_file_var_expand(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…