MCPcopy Index your code
hub / github.com/ipython/ipython / test_file_unicode

Function test_file_unicode

tests/test_magic.py:1353–1371  ·  view source on GitHub ↗

%%writefile with unicode cell

()

Source from the content-addressed store, hash-verified

1351
1352
1353def test_file_unicode():
1354 """%%writefile with unicode cell"""
1355 ip = get_ipython()
1356 with TemporaryDirectory() as td:
1357 fname = os.path.join(td, "file1")
1358 ip.run_cell_magic(
1359 "writefile",
1360 fname,
1361 "\n".join(
1362 [
1363 "liné1",
1364 "liné2",
1365 ]
1366 ),
1367 )
1368 with io.open(fname, encoding="utf-8") as f:
1369 s = f.read()
1370 assert "liné1\n" in s
1371 assert "liné2" in s
1372
1373
1374def test_file_amend():

Callers

nothing calls this directly

Calls 3

get_ipythonFunction · 0.90
run_cell_magicMethod · 0.80
readMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…