%%writefile with unicode cell
()
| 905 | nt.assert_in('line2', s) |
| 906 | |
| 907 | def test_file_unicode(): |
| 908 | """%%writefile with unicode cell""" |
| 909 | ip = get_ipython() |
| 910 | with TemporaryDirectory() as td: |
| 911 | fname = os.path.join(td, 'file1') |
| 912 | ip.run_cell_magic("writefile", fname, u'\n'.join([ |
| 913 | u'liné1', |
| 914 | u'liné2', |
| 915 | ])) |
| 916 | with io.open(fname, encoding='utf-8') as f: |
| 917 | s = f.read() |
| 918 | nt.assert_in(u'liné1\n', s) |
| 919 | nt.assert_in(u'liné2', s) |
| 920 | |
| 921 | def test_file_amend(): |
| 922 | """%%writefile -a amends files""" |
nothing calls this directly
no test coverage detected