def test_file_spaces():
    '%%file with spaces in filename'
    ip = get_ipython()
    with TemporaryWorkingDirectory() as td:
        fname = 'file name'
        ip.run_cell_magic('file', ('"%s"' % fname), u'\n'.join(['line1', 'line2']))
        with open(fname) as f:
            s = f.read()
        nt.assert_in('line1\n', s)
        nt.assert_in('line2', s)
%%file with spaces in filename
def test_file_spaces():
    
    ip = get_ipython()
    with TemporaryWorkingDirectory() as td:
        fname = 'file name'
        ip.run_cell_magic('file', ('"%s"' % fname), u'\n'.join(['line1', 'line2']))
        with open(fname) as f:
            s = f.read()
        nt.assert_in('line1\n', s)
        nt.assert_in('line2', s)