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

Function test_get_py_filename

IPython/utils/tests/test_path.py:301–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

299
300@with_environment
301def test_get_py_filename():
302 os.chdir(TMP_TEST_DIR)
303 with make_tempfile('foo.py'):
304 nt.assert_equal(path.get_py_filename('foo.py'), 'foo.py')
305 nt.assert_equal(path.get_py_filename('foo'), 'foo.py')
306 with make_tempfile('foo'):
307 nt.assert_equal(path.get_py_filename('foo'), 'foo')
308 nt.assert_raises(IOError, path.get_py_filename, 'foo.py')
309 nt.assert_raises(IOError, path.get_py_filename, 'foo')
310 nt.assert_raises(IOError, path.get_py_filename, 'foo.py')
311 true_fn = 'foo with spaces.py'
312 with make_tempfile(true_fn):
313 nt.assert_equal(path.get_py_filename('foo with spaces'), true_fn)
314 nt.assert_equal(path.get_py_filename('foo with spaces.py'), true_fn)
315 nt.assert_raises(IOError, path.get_py_filename, '"foo with spaces.py"')
316 nt.assert_raises(IOError, path.get_py_filename, "'foo with spaces.py'")
317
318@onlyif_unicode_paths
319def test_unicode_in_filename():

Callers

nothing calls this directly

Calls 1

make_tempfileFunction · 0.90

Tested by

no test coverage detected