()
| 321 | |
| 322 | @with_environment |
| 323 | def test_get_py_filename(): |
| 324 | os.chdir(TMP_TEST_DIR) |
| 325 | with make_tempfile("foo.py"): |
| 326 | assert path.get_py_filename("foo.py") == "foo.py" |
| 327 | assert path.get_py_filename("foo") == "foo.py" |
| 328 | with make_tempfile("foo"): |
| 329 | assert path.get_py_filename("foo") == "foo" |
| 330 | pytest.raises(IOError, path.get_py_filename, "foo.py") |
| 331 | pytest.raises(IOError, path.get_py_filename, "foo") |
| 332 | pytest.raises(IOError, path.get_py_filename, "foo.py") |
| 333 | true_fn = "foo with spaces.py" |
| 334 | with make_tempfile(true_fn): |
| 335 | assert path.get_py_filename("foo with spaces") == true_fn |
| 336 | assert path.get_py_filename("foo with spaces.py") == true_fn |
| 337 | pytest.raises(IOError, path.get_py_filename, '"foo with spaces.py"') |
| 338 | pytest.raises(IOError, path.get_py_filename, "'foo with spaces.py'") |
| 339 | |
| 340 | |
| 341 | @onlyif_unicode_paths |
nothing calls this directly
no test coverage detected
searching dependent graphs…