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

Function test_file_single_quote

IPython/core/tests/test_magic.py:863–875  ·  view source on GitHub ↗

Basic %%writefile with embedded single quotes

()

Source from the content-addressed store, hash-verified

861
862@dec.skip_win32
863def test_file_single_quote():
864 """Basic %%writefile with embedded single quotes"""
865 ip = get_ipython()
866 with TemporaryDirectory() as td:
867 fname = os.path.join(td, '\'file1\'')
868 ip.run_cell_magic("writefile", fname, u'\n'.join([
869 'line1',
870 'line2',
871 ]))
872 with open(fname) as f:
873 s = f.read()
874 nt.assert_in('line1\n', s)
875 nt.assert_in('line2', s)
876
877@dec.skip_win32
878def test_file_double_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