Basic %%writefile
()
| 846 | nt.assert_equal(c33, None) |
| 847 | |
| 848 | def 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 |
| 863 | def test_file_single_quote(): |
nothing calls this directly
no test coverage detected