()
| 407 | |
| 408 | @onlyif_unicode_paths |
| 409 | def test_ensure_dir_exists(): |
| 410 | with TemporaryDirectory() as td: |
| 411 | d = os.path.join(td, '∂ir') |
| 412 | path.ensure_dir_exists(d) # create it |
| 413 | assert os.path.isdir(d) |
| 414 | path.ensure_dir_exists(d) # no-op |
| 415 | f = os.path.join(td, 'ƒile') |
| 416 | open(f, 'w').close() # touch |
| 417 | with nt.assert_raises(IOError): |
| 418 | path.ensure_dir_exists(f) |
| 419 | |
| 420 | class TestLinkOrCopy(unittest.TestCase): |
| 421 | def setUp(self): |