()
| 299 | |
| 300 | @with_environment |
| 301 | def 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 |
| 319 | def test_unicode_in_filename(): |
nothing calls this directly
no test coverage detected