MCPcopy Create free account
hub / github.com/ipython/ipython / test_file

Function test_file

IPython/core/tests/test_magic.py:848–860  ·  view source on GitHub ↗

Basic %%writefile

()

Source from the content-addressed store, hash-verified

846 nt.assert_equal(c33, None)
847
848def test_file():
849 """Basic %%writefile"""
850 ip = get_ipython()
851 with TemporaryDirectory() as td:
852 fname = os.path.join(td, 'file1')
853 ip.run_cell_magic("writefile", fname, u'\n'.join([
854 'line1',
855 'line2',
856 ]))
857 with open(fname) as f:
858 s = f.read()
859 nt.assert_in('line1\n', s)
860 nt.assert_in('line2', s)
861
862@dec.skip_win32
863def test_file_single_quote():

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