Test functions that call path_error2(), providing two filenames in their exceptions.
(self)
| 1478 | raise unittest.SkipTest("OSError raised!") |
| 1479 | |
| 1480 | def test_path_error2(self): |
| 1481 | """ |
| 1482 | Test functions that call path_error2(), providing two filenames in their exceptions. |
| 1483 | """ |
| 1484 | for name in ("rename", "replace", "link"): |
| 1485 | function = getattr(os, name, None) |
| 1486 | if function is None: |
| 1487 | continue |
| 1488 | |
| 1489 | for dst in ("noodly2", os_helper.TESTFN): |
| 1490 | try: |
| 1491 | function('doesnotexistfilename', dst) |
| 1492 | except OSError as e: |
| 1493 | self.assertIn("'doesnotexistfilename' -> '{}'".format(dst), str(e)) |
| 1494 | break |
| 1495 | else: |
| 1496 | self.fail("No valid path_error2() test for os." + name) |
| 1497 | |
| 1498 | def test_path_with_null_character(self): |
| 1499 | fn = os_helper.TESTFN |